on xenial help sign in
fix negative progress causing invisible tiles
commit0562e668cf5ce5742388f66b7338d5d38f3461f5 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 24 Aug 2016, 13:11 (10 years ago) parent96e3d94
3 files changed+3−20
qml/Stage/DecoratedWindow.qml+1−1 qml/Stage/Spread/StagedRightEdgeMaths.qml+1−2 qml/Stage/Stage.qml+1−17
qml/Stage/DecoratedWindow.qml+1−1
@@ -82,7 +82,7 @@ FocusScope {
8282 StateGroup {
8383 states: [
8484 State {
85− name: "normal"; when: root.scaleToPreviewProgress == 0
85+ name: "normal"; when: root.scaleToPreviewProgress <= 0
8686 PropertyChanges {
8787 target: root
8888 implicitWidth: applicationWindow.implicitWidth
qml/Stage/Spread/StagedRightEdgeMaths.qml+1−2
@@ -35,8 +35,7 @@ QtObject {
3535 // Output
3636
3737 readonly property real scaleToPreviewProgress: {
38−// print("scaleProg:", progress < breakPoint ? 0 : MathUtils.linearAnimation(breakPoint, 1.0, 0.0, 1.0, progress))
39− return progress < breakPoint ? 0 : MathUtils.linearAnimation(0.5, 1.0, 0.0, 1.0, progress)
38+ return progress < breakPoint ? 0 : MathUtils.clamp(MathUtils.linearAnimation(0.5, 1.0, 0.0, 1.0, progress), 0, 1)
4039 }
4140 readonly property int animatedWidth: {
4241 return progress < breakPoint ? root.sceneHeight : MathUtils.linearAnimation(breakPoint, 1, root.sceneWidth, targetHeight, progress)
qml/Stage/Stage.qml+1−17
@@ -819,7 +819,7 @@ AbstractStage {
819819 targetScale: spreadMaths.targetScale
820820 }
821821
822−// onXChanged: if (model.application.appId == "unity8-dash") print("dash moved to", x)
822+ onXChanged: if (model.application.appId == "unity8-dash") print("dash moved to", x)
823823// onRequestedWidthChanged: if (index == 0) print("requestedWidth", requestedWidth)
824824 onStateChanged: if (model.application.appId == "unity8-dash") print("state changed", state)
825825 states: [
@@ -1304,24 +1304,8 @@ AbstractStage {
13041304 property var gesturePoints: new Array()
13051305
13061306 property real progress: -touchPosition.x / root.width
1307−// onProgressChanged: print("dda progress", progress, root.width, touchPosition.x, root.width + touchPosition.x)
13081307
1309−// Rectangle { color: "blue"; anchors.fill: parent }
13101308 onTouchPositionChanged: {
1311− if (dragging) {
1312− // Gesture recognized. Let's move the spreadView with the finger
1313−// var dragX = Math.min(touchX + width, width); // Prevent dragging rightwards
1314−// dragX = -dragX + spreadDragArea.width - spreadView.shift;
1315−// // Don't allow dragging further than the animation crossing with phase2's animation
1316−// var maxMovement = spreadView.width * spreadView.positionMarker4 - spreadView.shift;
1317−
1318−// spreadView.contentX = Math.min(dragX, maxMovement);
1319− } else {
1320−// // Initial touch. Let's reset the spreadView to the starting position.
1321−// spreadView.phase = 0;
1322−// spreadView.contentX = -spreadView.shift;
1323− }
1324−
13251309 gesturePoints.push(touchPosition.x);
13261310 }
13271311