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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/BezierUI.js

Issue 2299473002: DevTools: Move BezierEditor from elements/ to ui/ (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {number} width 7 * @param {number} width
8 * @param {number} height 8 * @param {number} height
9 * @param {number} marginTop 9 * @param {number} marginTop
10 * @param {number} controlPointRadius 10 * @param {number} controlPointRadius
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 var current = bezier.evaluateAt(t); 118 var current = bezier.evaluateAt(t);
119 var slope = (current.y - prev.y) / (current.x - prev.x); 119 var slope = (current.y - prev.y) / (current.x - prev.x);
120 var weightedX = prev.x * (1 - t) + current.x * t; 120 var weightedX = prev.x * (1 - t) + current.x * t;
121 slope = Math.tanh(slope / 1.5); // Normalise slope 121 slope = Math.tanh(slope / 1.5); // Normalise slope
122 pathBuilder = pathBuilder.concat(["L", (weightedX * width).toFixed(2), ( height - slope * height).toFixed(2) ]); 122 pathBuilder = pathBuilder.concat(["L", (weightedX * width).toFixed(2), ( height - slope * height).toFixed(2) ]);
123 prev = current; 123 prev = current;
124 } 124 }
125 pathBuilder = pathBuilder.concat(["L", width.toFixed(2), height, "Z"]); 125 pathBuilder = pathBuilder.concat(["L", width.toFixed(2), height, "Z"]);
126 path.setAttribute("d", pathBuilder.join(" ")); 126 path.setAttribute("d", pathBuilder.join(" "));
127 } 127 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698