on xenial help sign in
improve comments around progress a bit
1746bb8Michael Zanetti
qml/Stages/PhoneStage.qml+8−4
@@ -288,16 +288,20 @@ Item {
288 }
288 }
289
289
290 // Each tile has a different progress value running from 0 to 1.
290 // Each tile has a different progress value running from 0 to 1.
291− // A progress value of 0 means the tile is at the right edge. 1 means the tile has reched the left edge.
291+ // 0: means the tile is at the right edge.
292+ // 1: means the tile has finished the main animation towards the left edge.
293+ // >1: after the main animation has finished, tiles will continue to move very slowly to the left
292 progress: {
294 progress: {
293 var tileProgress = (spreadView.shiftedContentX - behavioredIndex * spreadView.tileDistance) / spreadView.width;
295 var tileProgress = (spreadView.shiftedContentX - behavioredIndex * spreadView.tileDistance) / spreadView.width;
294 // Tile 1 needs to move directly from the beginning...
296 // Tile 1 needs to move directly from the beginning...
295 if (behavioredIndex == 1 && spreadView.phase < 2) {
297 if (behavioredIndex == 1 && spreadView.phase < 2) {
296 tileProgress += spreadView.tileDistance / spreadView.width;
298 tileProgress += spreadView.tileDistance / spreadView.width;
297 }
299 }
298− // Limiting progress to ~0 and 1.7 to avoid binding calculations when tiles are either
300+ // Limiting progress to ~0 and 1.7 to avoid binding calculations when tiles are not
301+ // visible.
299− // outside the screen on the right (progress < 0) or hidden by other tiles on the left
302+ // < 0 : The tile is outside the screen on the right
303+ // > 1.7: The tile is *very* close to the left edge and covered by other tiles now.
300− // (> 1.7). Using 0.0001 to differentiate when a tile should still be visible (==0)
304+ // Using 0.0001 to differentiate when a tile should still be visible (==0)
301 // or we can hide it (< 0)
305 // or we can hide it (< 0)
302 tileProgress = Math.max(-0.0001, Math.min(1.7, tileProgress));
306 tileProgress = Math.max(-0.0001, Math.min(1.7, tileProgress));
303 return tileProgress;
307 return tileProgress;