Title: [259017] trunk/Tools
Revision
259017
Author
zhifei_f...@apple.com
Date
2020-03-25 16:05:41 -0700 (Wed, 25 Mar 2020)

Log Message

[Timeline] Fix the out of bound dot index
https://bugs.webkit.org/show_bug.cgi?id=209492

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(Timeline.CanvasSeriesComponent):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (259016 => 259017)


--- trunk/Tools/ChangeLog	2020-03-25 22:53:10 UTC (rev 259016)
+++ trunk/Tools/ChangeLog	2020-03-25 23:05:41 UTC (rev 259017)
@@ -1,3 +1,13 @@
+2020-03-25  Zhifei Fang  <zhifei_f...@apple.com>
+
+        [Timeline] Fix the out of bound dot index
+        https://bugs.webkit.org/show_bug.cgi?id=209492
+
+        Reviewed by Jonathan Bedard.
+
+        * resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
+        (Timeline.CanvasSeriesComponent):
+
 2020-03-25  Daniel Bates  <daba...@apple.com>
 
         Element context character rects may be in wrong coordinate system

Modified: trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js (259016 => 259017)


--- trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js	2020-03-25 22:53:10 UTC (rev 259016)
+++ trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js	2020-03-25 23:05:41 UTC (rev 259017)
@@ -385,10 +385,8 @@
         let endScalesIndex = startScalesIndex + Math.ceil((renderWidth) / dotWidth);
         if (endScalesIndex >= scales.length)
             endScalesIndex = scales.length - 1;
-        let currentDotIndex = startScalesIndex - (scales.length - dots.length);
-        if (currentDotIndex < 0)
-            currentDotIndex = 0;
-        for (let i = currentDotIndex; i <= startScalesIndex; i++) {
+        let currentDotIndex = 0;
+        for (let i = currentDotIndex; i <= startScalesIndex && currentDotIndex < dots.length; i++) {
             const compResult = comp(scales[startScalesIndex], getScale(dots[currentDotIndex]));
             if (!reversed) {
                 if (compResult > 0)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to