on xenial help sign in
more accurate left/top/right hit testing
bb2f7b5Lukáš Tinkl
qml/Stages/MoveHandler.qml+6−6
@@ -144,18 +144,18 @@ Item {
144 priv.resetEdges();
144 priv.resetEdges();
145 priv.nearBottomRightCorner = true;
145 priv.nearBottomRightCorner = true;
146 root.fakeMaximizeBottomRightAnimationRequested(priv.progress);
146 root.fakeMaximizeBottomRightAnimationRequested(priv.progress);
147− } else if (sensingPoints.topLeft.x < priv.triggerArea && target.canBeMaximizedLeftRight) { // left
147+ } else if (sensingPoints.left.x < priv.triggerArea && target.canBeMaximizedLeftRight) { // left
148− priv.progress = MathUtils.clampAndProject(sensingPoints.topLeft.x, priv.triggerArea, 0, 0, 1);
148+ priv.progress = MathUtils.clampAndProject(sensingPoints.left.x, priv.triggerArea, 0, 0, 1);
149 priv.resetEdges();
149 priv.resetEdges();
150 priv.nearLeftEdge = true;
150 priv.nearLeftEdge = true;
151 root.fakeMaximizeLeftAnimationRequested(priv.progress);
151 root.fakeMaximizeLeftAnimationRequested(priv.progress);
152− } else if (sensingPoints.topRight.x > stageWidth - priv.triggerArea && target.canBeMaximizedLeftRight) { // right
152+ } else if (sensingPoints.right.x > stageWidth - priv.triggerArea && target.canBeMaximizedLeftRight) { // right
153− priv.progress = MathUtils.clampAndProject(sensingPoints.topRight.x, stageWidth - priv.triggerArea, stageWidth, 0, 1);
153+ priv.progress = MathUtils.clampAndProject(sensingPoints.right.x, stageWidth - priv.triggerArea, stageWidth, 0, 1);
154 priv.resetEdges();
154 priv.resetEdges();
155 priv.nearRightEdge = true;
155 priv.nearRightEdge = true;
156 root.fakeMaximizeRightAnimationRequested(priv.progress);
156 root.fakeMaximizeRightAnimationRequested(priv.progress);
157− } else if (sensingPoints.topLeft.y < PanelState.panelHeight && target.canBeMaximized) { // top
157+ } else if (sensingPoints.top.y < PanelState.panelHeight && target.canBeMaximized) { // top
158− priv.progress = MathUtils.clampAndProject(sensingPoints.topLeft.y, Math.max(PanelState.panelHeight, priv.triggerArea), 0, 0, 1);
158+ priv.progress = MathUtils.clampAndProject(sensingPoints.top.y, Math.max(PanelState.panelHeight, priv.triggerArea), 0, 0, 1);
159 priv.resetEdges();
159 priv.resetEdges();
160 priv.nearTopEdge = true;
160 priv.nearTopEdge = true;
161 root.fakeMaximizeAnimationRequested(priv.progress);
161 root.fakeMaximizeAnimationRequested(priv.progress);
qml/Stages/WindowControlsOverlay.qml+3
@@ -107,6 +107,9 @@ Item {
107 var bottommost = Math.max.apply(Math, yPoints);
107 var bottommost = Math.max.apply(Math, yPoints);
108
108
109 return {
109 return {
110+ left: mapToItem(target.parent, leftmost, (topmost+bottommost)/2),
111+ top: mapToItem(target.parent, (leftmost+rightmost)/2, topmost),
112+ right: mapToItem(target.parent, rightmost, (topmost+bottommost)/2),
110 topLeft: mapToItem(target.parent, leftmost, topmost),
113 topLeft: mapToItem(target.parent, leftmost, topmost),
111 topRight: mapToItem(target.parent, rightmost, topmost),
114 topRight: mapToItem(target.parent, rightmost, topmost),
112 bottomLeft: mapToItem(target.parent, leftmost, bottommost),
115 bottomLeft: mapToItem(target.parent, leftmost, bottommost),