Bug 1261561 - Part 1: Fix TimeScale.getAnimationDimensions() to handle multiple iterations r?pbro draft
authorRyo Kato <ryo_kato@hashedhyphen.com>
Mon, 04 Apr 2016 08:32:39 -0700
changeset 347302 1e7a258d5378c889176d5029896b8a8ef0ab05dd
parent 347283 9bd90088875399347b05d87c67d3709e31539dcd
child 347609 6a73bf6e72648a4825de423ae40161892779b7cf
child 347610 7bb1dcc6757b5343fd33171b8e048c2211682451
child 348290 e0d500927912df4174a54f75c6afc9fb88889790
push id14548
push userbmo:ryo_kato@hashedhyphen.com
push dateMon, 04 Apr 2016 15:47:09 +0000
reviewerspbro
bugs1261561
milestone48.0a1
Bug 1261561 - Part 1: Fix TimeScale.getAnimationDimensions() to handle multiple iterations r?pbro MozReview-Commit-ID: FUjebmapYH1
devtools/client/animationinspector/utils.js
--- a/devtools/client/animationinspector/utils.js
+++ b/devtools/client/animationinspector/utils.js
@@ -323,17 +323,18 @@ var TimeScale = {
     let delayX = delay < 0 ? x : this.startTimeToDistance(start);
     // The width of the delay.
     let delayW = this.durationToDistance(Math.abs(delay) / rate);
     // The width of the delay if it is negative, 0 otherwise.
     let negativeDelayW = delay < 0 ? delayW : 0;
     // The width of the endDelay.
     let endDelayW = this.durationToDistance(Math.abs(endDelay) / rate);
     // The start position of the endDelay.
-    let endDelayX = endDelay < 0 ? x + w - endDelayW : x + w;
+    let endDelayX = endDelay < 0 ? x + iterationW - endDelayW
+                                 : x + iterationW;
 
     return {x, w, iterationW, delayX, delayW, negativeDelayW,
             endDelayX, endDelayW};
   },
 
   /**
    * Given an animation, get the background data for .iterations element.
    * This background represents iterationCount and iterationStart.