diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-08 12:04:13 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-08 12:04:13 +0100 |
commit | 6cebf3bf0e5d3cade7b0a7dc9c8feb191b2eb91f (patch) | |
tree | 3f511399ec23f9d653f2c08f9c62afb4412f0542 /src/elements/Circle.js | |
parent | 24111571324badc5282cf835c6565576d7fcb90f (diff) | |
download | svg.js-6cebf3bf0e5d3cade7b0a7dc9c8feb191b2eb91f.tar.gz svg.js-6cebf3bf0e5d3cade7b0a7dc9c8feb191b2eb91f.zip |
size function of circle now only accepts one argument (#788)
Diffstat (limited to 'src/elements/Circle.js')
-rw-r--r-- | src/elements/Circle.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/elements/Circle.js b/src/elements/Circle.js index c296885..52aaa3d 100644 --- a/src/elements/Circle.js +++ b/src/elements/Circle.js @@ -1,4 +1,4 @@ -import { cx, cy, height, size, width, x, y } from '../modules/core/circled.js' +import { cx, cy, height, width, x, y } from '../modules/core/circled.js' import { extend, nodeOrNew, register } from '../utils/adopter.js' import { registerMethods } from '../utils/methods.js' import SVGNumber from '../types/SVGNumber.js' @@ -22,16 +22,20 @@ export default class Circle extends Shape { ry (ry) { return this.rx(ry) } + + size (size) { + return this.radius(new SVGNumber(size).divide(2)) + } } -extend(Circle, { x, y, cx, cy, width, height, size }) +extend(Circle, { x, y, cx, cy, width, height }) registerMethods({ Element: { // Create circle element circle (size) { return this.put(new Circle()) - .radius(new SVGNumber(size).divide(2)) + .size(size) .move(0, 0) } } |