mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
parent
9c9f40d05a
commit
79d446136a
1 changed files with 4 additions and 3 deletions
|
@ -2320,11 +2320,12 @@ new function() { // PostScript-style drawing commands
|
||||||
} else {
|
} else {
|
||||||
// #3: arcTo(to, radius, rotation, clockwise, large)
|
// #3: arcTo(to, radius, rotation, clockwise, large)
|
||||||
// Drawing arcs in SVG style:
|
// Drawing arcs in SVG style:
|
||||||
var radius = Size.read(arguments);
|
var radius = Size.read(arguments),
|
||||||
|
isZero = Numerical.isZero;
|
||||||
// If rx = 0 or ry = 0 then this arc is treated as a
|
// If rx = 0 or ry = 0 then this arc is treated as a
|
||||||
// straight line joining the endpoints.
|
// straight line joining the endpoints.
|
||||||
if (Numerical.isZero(radius.width)
|
// NOTE: radius.isZero() would require both values to be 0.
|
||||||
|| Numerical.isZero(radius.height))
|
if (isZero(radius.width) || isZero(radius.height))
|
||||||
return this.lineTo(to);
|
return this.lineTo(to);
|
||||||
// See for an explanation of the following calculations:
|
// See for an explanation of the following calculations:
|
||||||
// http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
|
// http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
|
||||||
|
|
Loading…
Reference in a new issue