mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
SVG: Use new Path.Ellipse constructor.
This commit is contained in:
parent
01a0920c92
commit
d45ba19914
1 changed files with 6 additions and 4 deletions
|
@ -242,10 +242,12 @@ new function() {
|
|||
|
||||
// http://www.w3.org/TR/SVG/shapes.html#InterfaceSVGEllipseElement
|
||||
ellipse: function(node) {
|
||||
var center = getPoint(node, 'cx', 'cy'),
|
||||
radius = getSize(node, 'rx', 'ry');
|
||||
return new Path.Ellipse(new Rectangle(center.subtract(radius),
|
||||
center.add(radius)));
|
||||
// We only use object literal notation where the default one is not
|
||||
// supported (e.g. center / radius fo Path.Ellipse).
|
||||
return new Path.Ellipse({
|
||||
center: getPoint(node, 'cx', 'cy'),
|
||||
radius: getSize(node, 'rx', 'ry')
|
||||
});
|
||||
},
|
||||
|
||||
// http://www.w3.org/TR/SVG/shapes.html#RectElement
|
||||
|
|
Loading…
Reference in a new issue