Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: Source/devtools/front_end/elements/BezierUI.js

Issue 1155773002: Devtools Animations: Add cubic bezier easing editor for animations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/elements/BezierUI.js
diff --git a/Source/devtools/front_end/elements/BezierUI.js b/Source/devtools/front_end/elements/BezierUI.js
index 2a9b716fd317eb9e730c768dfb4878a302543c40..5964f4ed59cd7b28c6d8046c4de5bd93e6e58d90 100644
--- a/Source/devtools/front_end/elements/BezierUI.js
+++ b/Source/devtools/front_end/elements/BezierUI.js
@@ -117,6 +117,9 @@ WebInspector.BezierUI.drawVelocityChart = function(bezier, path, width)
var slope = (current.y - prev.y) / (current.x - prev.x);
var weightedX = prev.x * (1 - t) + current.x * t;
slope = Math.tanh(slope / 1.5); // Normalise slope
+ // TODO(samli): Workaround for v8 bug https://code.google.com/p/v8/issues/detail?id=3495
+ if (isNaN(slope))
+ slope = 1;
pathBuilder = pathBuilder.concat(["L", (weightedX * width).toFixed(2), (height - slope * height).toFixed(2) ]);
prev = current;
}
« no previous file with comments | « Source/devtools/front_end/elements/AnimationTimeline.js ('k') | Source/devtools/front_end/elements/StylesPopoverHelper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698