@@ -72,16 +72,16 @@ DirectionalDragArea {
72 onDistanceChanged: {
72 onDistanceChanged: {
73 if (status === DirectionalDragArea.Recognized) {
73 if (status === DirectionalDragArea.Recognized) {
74 // don't go the whole distance in order to smooth out the movement
74 // don't go the whole distance in order to smooth out the movement
75− var step = distance * 0.3
75+ var step = distance * 0.3;
77− step = __limitMovement(step)
77+ step = __limitMovement(step);
79− __totalDragDistance += step
79+ __totalDragDistance += step;
81 if (Direction.isHorizontal(direction)) {
81 if (Direction.isHorizontal(direction)) {
82− parent.x += step
82+ parent.x += step;
84− parent.y += step
84+ parent.y += step;
@@ -90,56 +90,59 @@ DirectionalDragArea {
90 function __limitMovement(step) {
90 function __limitMovement(step) {
91 if (Direction.isPositive(direction)) {
91 if (Direction.isPositive(direction)) {
92 if (__totalDragDistance + step > maxTotalDragDistance) {
92 if (__totalDragDistance + step > maxTotalDragDistance) {
93− step = maxTotalDragDistance - __totalDragDistance
93+ step = maxTotalDragDistance - __totalDragDistance;
94 } else if (__totalDragDistance + step < 0) {
94 } else if (__totalDragDistance + step < 0) {
95− step = 0 - __totalDragDistance
95+ step = 0 - __totalDragDistance;
98 if (__totalDragDistance + step < -maxTotalDragDistance) {
98 if (__totalDragDistance + step < -maxTotalDragDistance) {
99− step = -maxTotalDragDistance - __totalDragDistance
99+ step = -maxTotalDragDistance - __totalDragDistance;
100 } else if (__totalDragDistance + step > 0) {
100 } else if (__totalDragDistance + step > 0) {
101− step = 0 - __totalDragDistance
101+ step = 0 - __totalDragDistance;
105− return step
105+ return step;
108 onStatusChanged: {
108 onStatusChanged: {
109 if (status === DirectionalDragArea.WaitingForTouch) {
109 if (status === DirectionalDragArea.WaitingForTouch) {
110 if (__previousStatus === DirectionalDragArea.Recognized) {
110 if (__previousStatus === DirectionalDragArea.Recognized) {
111− __onFinishedRecognizedGesture()
111+ __onFinishedRecognizedGesture();
113− __totalDragDistance = 0
113+ __totalDragDistance = 0;
115 else if (status === DirectionalDragArea.Undecided) {
115 else if (status === DirectionalDragArea.Undecided) {
116− dragEvaluator.reset()
116+ dragEvaluator.reset();
118 else if (status === DirectionalDragArea.Recognized) {
118 else if (status === DirectionalDragArea.Recognized) {
119 if (__previousStatus === DirectionalDragArea.WaitingForTouch)
119 if (__previousStatus === DirectionalDragArea.WaitingForTouch)
120− dragEvaluator.reset()
120+ dragEvaluator.reset();
122− __previousStatus = status
122+ __previousStatus = status;
125 function __onFinishedRecognizedGesture() {
125 function __onFinishedRecognizedGesture() {
126− if (dragEvaluator.shouldAutoComplete())
126+ if (dragEvaluator.shouldAutoComplete()) {
127− __completeDrag()
127+ __completeDrag();
129− __rollbackDrag()
129+ __rollbackDrag();
132 function __completeDrag() {
133 function __completeDrag() {
133− if (parent.shown)
134+ if (parent.shown) {
134− parent.hide()
135+ parent.hide();
136− parent.show()
137+ parent.show();
139 function __rollbackDrag() {
141 function __rollbackDrag() {
140− if (parent.shown)
142+ if (parent.shown) {
141− parent.show()
143+ parent.show();
143− parent.hide()
145+ parent.hide();