@@ -110,115 +110,90 @@ SpreadDelegate {
110 return priv.selectedXTranslate;
110 return priv.selectedXTranslate;
113− var translation = 0;
114 switch (index) {
113 switch (index) {
116 if (spreadView.stage == 0) {
115 if (spreadView.stage == 0) {
117− translation = linearAnimation(0, spreadView.positionMarker2, 0, -spreadView.width * .25, root.animatedProgress)
116+ return linearAnimation(0, spreadView.positionMarker2, 0, -spreadView.width * .25, root.animatedProgress)
119 } else if (spreadView.stage == 1){
117 } else if (spreadView.stage == 1){
120− translation = linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, -spreadView.width * .25, priv.stage2startTranslate, root.progress)
118+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, -spreadView.width * .25, priv.stage2startTranslate, root.progress)
122 } else if (!priv.isSelected){ // Stage 2
119 } else if (!priv.isSelected){ // Stage 2
123− // Move the first tile a bit to the right to be aligned with the others
124− translation += spreadView.width
125− // apply the same animation as with the rest
120+ // Apply the same animation as with the rest but add spreadView.width to align it with the others.
126− translation += -easingCurve.value * spreadView.width
121+ return -easingCurve.value * spreadView.width + spreadView.width
128 } else if (priv.isSelected) {
122 } else if (priv.isSelected) {
129− translation = linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, 0, root.progress)
123+ return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, 0, root.progress)
134 if (spreadView.stage == 0 && !priv.isSelected) {
127 if (spreadView.stage == 0 && !priv.isSelected) {
135− translation = linearAnimation(0, spreadView.positionMarker2, 0, -spreadView.width * spreadView.snapPosition, root.animatedProgress)
128+ return linearAnimation(0, spreadView.positionMarker2, 0, -spreadView.width * spreadView.snapPosition, root.animatedProgress)
137 } else if (spreadView.stage == 1 && !priv.isSelected) {
129 } else if (spreadView.stage == 1 && !priv.isSelected) {
138− translation = linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
130+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
139 -spreadView.width * spreadView.snapPosition, priv.stage2startTranslate, root.progress);
131 -spreadView.width * spreadView.snapPosition, priv.stage2startTranslate, root.progress);
144− // Fix it at the right edge...
145− translation += -((index - 1) * root.startDistance)
146− // ...and use our easing to move them to the left. Stop a bit earlier for each tile
147− translation += -easingCurve.value * spreadView.width + (index * root.endDistance)
148− if (priv.isSelected) {
135+ if (priv.isSelected) {
149− // Distance to left edge
136+ // Distance to left edge
150− var targetTranslate = -spreadView.width - ((index - 1) * root.startDistance)
137+ var targetTranslate = -spreadView.width - ((index - 1) * root.startDistance)
151− translation = linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, targetTranslate, root.progress)
138+ return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, targetTranslate, root.progress)
154− return translation;
140+
141+ // Fix it at the right edge...
142+ var rightEdgeOffset = -((index - 1) * root.startDistance)
143+ // ...and use our easing to move them to the left. Stop a bit earlier for each tile
144+ return -easingCurve.value * spreadView.width + (index * root.endDistance) + rightEdgeOffset
156 property real angle: {
148 property real angle: {
157 if (priv.otherSelected) {
149 if (priv.otherSelected) {
158 return priv.selectedAngle
150 return priv.selectedAngle
160−
152+ if (priv.isSelected) {
161− var newAngle = 0;
153+ return linearAnimation(selectedProgress, negativeProgress, selectedAngle, 0, root.progress)
162 switch (index) {
155 switch (index) {
164 if (spreadView.stage == 0) {
157 if (spreadView.stage == 0) {
165− newAngle = linearAnimation(0, spreadView.positionMarker2, 0, root.tile0SnapAngle, root.animatedProgress)
158+ return linearAnimation(0, spreadView.positionMarker2, 0, root.tile0SnapAngle, root.animatedProgress)
167 } else if (spreadView.stage == 1) {
159 } else if (spreadView.stage == 1) {
168− newAngle = linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, root.tile0SnapAngle, stage2startAngle, root.progress)
160+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, root.tile0SnapAngle, stage2startAngle, root.progress)
172− if (spreadView.stage == 0 && !priv.isSelected) {
163+ if (spreadView.stage == 0) {
173− newAngle = linearAnimation(0, spreadView.positionMarker2, root.startAngle, root.startAngle * (1-spreadView.snapPosition), root.animatedProgress)
164+ return linearAnimation(0, spreadView.positionMarker2, root.startAngle, root.startAngle * (1-spreadView.snapPosition), root.animatedProgress)
175− } else if (spreadView.stage == 1 && !priv.isSelected) {
165+ } else if (spreadView.stage == 1) {
176− newAngle = linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, root.startAngle * (1-spreadView.snapPosition), priv.stage2startAngle, root.progress)
166+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, root.startAngle * (1-spreadView.snapPosition), priv.stage2startAngle, root.progress)
181− newAngle = root.startAngle - easingCurve.value * (root.startAngle - root.endAngle)
182− if (priv.isSelected) {
183− newAngle = linearAnimation(selectedProgress, negativeProgress, selectedAngle, 0, root.progress)
186−
169+ return root.startAngle - easingCurve.value * (root.startAngle - root.endAngle)
189 property real scale: {
172 property real scale: {
190 if (priv.otherSelected) {
173 if (priv.otherSelected) {
191 return priv.selectedScale;
174 return priv.selectedScale;
176+ if (priv.isSelected) {
177+ return linearAnimation(selectedProgress, negativeProgress, selectedScale, 1, root.progress)
195 switch (index) {
180 switch (index) {
197 if (spreadView.stage == 0) {
182 if (spreadView.stage == 0) {
198− newScale = 1;
183+ return 1;
200 } else if(spreadView.stage == 1) {
184 } else if(spreadView.stage == 1) {
201− newScale = linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, 1, stage2startScale, root.progress)
185+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, 1, stage2startScale, root.progress)
205− if (spreadView.stage == 0 && !priv.isSelected) {
188+ if (spreadView.stage == 0) {
206 var targetScale = tile1StartScale - ((tile1StartScale - 1) * spreadView.snapPosition);
189 var targetScale = tile1StartScale - ((tile1StartScale - 1) * spreadView.snapPosition);
207− newScale = linearAnimation(0, spreadView.positionMarker2, root.tile1StartScale, targetScale, root.animatedProgress)
190+ return linearAnimation(0, spreadView.positionMarker2, root.tile1StartScale, targetScale, root.animatedProgress)
209− } else if (spreadView.stage == 1 && !priv.isSelected) {
191+ } else if (spreadView.stage == 1) {
210 var startScale = tile1StartScale - ((tile1StartScale - 1) * spreadView.snapPosition);
192 var startScale = tile1StartScale - ((tile1StartScale - 1) * spreadView.snapPosition);
211− newScale = linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, startScale, priv.stage2startScale, root.progress)
193+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, startScale, priv.stage2startScale, root.progress)
216− newScale = root.startScale - easingCurve.value * (root.startScale - root.endScale)
217− if (priv.isSelected) {
218− newScale = linearAnimation(selectedProgress, negativeProgress, selectedScale, 1, root.progress)
221− return newScale;
196+ return root.startScale - easingCurve.value * (root.startScale - root.endScale)
224 property real opacity: {
199 property real opacity: {