- Fix (regression): Star tool (radialshift)
This commit is contained in:
4
dist/extensions/ext-star.js
vendored
4
dist/extensions/ext-star.js
vendored
@@ -157,7 +157,7 @@
|
|||||||
fill = c.fill,
|
fill = c.fill,
|
||||||
strokecolor = c.strokecolor,
|
strokecolor = c.strokecolor,
|
||||||
strokeWidth = c.strokeWidth,
|
strokeWidth = c.strokeWidth,
|
||||||
radialShift = c.radialShift,
|
radialshift = c.radialshift,
|
||||||
point = c.point,
|
point = c.point,
|
||||||
orient = c.orient,
|
orient = c.orient,
|
||||||
circumradius = Math.sqrt((x - cx) * (x - cx) + (y - cy) * (y - cy)) / 1.5,
|
circumradius = Math.sqrt((x - cx) * (x - cx) + (y - cy) * (y - cy)) / 1.5,
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
} else if (orient === 'edge') {
|
} else if (orient === 'edge') {
|
||||||
angle = angle + Math.PI / point - Math.PI / 2;
|
angle = angle + Math.PI / point - Math.PI / 2;
|
||||||
}
|
}
|
||||||
angle += radialShift;
|
angle += radialshift;
|
||||||
|
|
||||||
x = inradius * Math.cos(angle) + cx;
|
x = inradius * Math.cos(angle) + cx;
|
||||||
y = inradius * Math.sin(angle) + cy;
|
y = inradius * Math.sin(angle) + cy;
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ svgEditor.addExtension('star', function (S) {
|
|||||||
|
|
||||||
let x = opts.mouse_x;
|
let x = opts.mouse_x;
|
||||||
let y = opts.mouse_y;
|
let y = opts.mouse_y;
|
||||||
const {cx, cy, fill, strokecolor, strokeWidth, radialShift, point, orient} = c,
|
const {cx, cy, fill, strokecolor, strokeWidth, radialshift, point, orient} = c,
|
||||||
circumradius = (Math.sqrt((x - cx) * (x - cx) + (y - cy) * (y - cy))) / 1.5,
|
circumradius = (Math.sqrt((x - cx) * (x - cx) + (y - cy) * (y - cy))) / 1.5,
|
||||||
inradius = circumradius / document.getElementById('starRadiusMulitplier').value;
|
inradius = circumradius / document.getElementById('starRadiusMulitplier').value;
|
||||||
newFO.setAttributeNS(null, 'r', circumradius);
|
newFO.setAttributeNS(null, 'r', circumradius);
|
||||||
@@ -176,7 +176,7 @@ svgEditor.addExtension('star', function (S) {
|
|||||||
} else if (orient === 'edge') {
|
} else if (orient === 'edge') {
|
||||||
angle = (angle + (Math.PI / point)) - (Math.PI / 2);
|
angle = (angle + (Math.PI / point)) - (Math.PI / 2);
|
||||||
}
|
}
|
||||||
angle += radialShift;
|
angle += radialshift;
|
||||||
|
|
||||||
x = (inradius * Math.cos(angle)) + cx;
|
x = (inradius * Math.cos(angle)) + cx;
|
||||||
y = (inradius * Math.sin(angle)) + cy;
|
y = (inradius * Math.sin(angle)) + cy;
|
||||||
|
|||||||
Reference in New Issue
Block a user