mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-24 05:03:44 +00:00
restored path parsing cache (#3347)
* restored path parsing cache * Update arc.js
This commit is contained in:
parent
7af65b05bd
commit
e54dc3bffb
1 changed files with 4 additions and 9 deletions
|
|
@ -152,18 +152,13 @@
|
|||
*/
|
||||
fabric.util.getBoundsOfArc = function(fx, fy, rx, ry, rot, large, sweep, tx, ty) {
|
||||
|
||||
var fromX = 0, fromY = 0, bound = [], bounds = [],
|
||||
segs = arcToSegments(tx - fx, ty - fy, rx, ry, large, sweep, rot),
|
||||
boundCopy = [[], []];
|
||||
var fromX = 0, fromY = 0, bound, bounds = [],
|
||||
segs = arcToSegments(tx - fx, ty - fy, rx, ry, large, sweep, rot);
|
||||
|
||||
for (var i = 0, len = segs.length; i < len; i++) {
|
||||
bound = getBoundsOfCurve(fromX, fromY, segs[i][0], segs[i][1], segs[i][2], segs[i][3], segs[i][4], segs[i][5]);
|
||||
boundCopy[0].x = bound[0].x + fx;
|
||||
boundCopy[0].y = bound[0].y + fy;
|
||||
boundCopy[1].x = bound[1].x + fx;
|
||||
boundCopy[1].y = bound[1].y + fy;
|
||||
bounds.push(boundCopy[0]);
|
||||
bounds.push(boundCopy[1]);
|
||||
bounds.push({ x: bound[0].x + fx, y: bound[0].y + fy });
|
||||
bounds.push({ x: bound[1].x + fx, y: bound[1].y + fy });
|
||||
fromX = segs[i][4];
|
||||
fromY = segs[i][5];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue