aboutsummaryrefslogtreecommitdiffstats
path: root/src/elements/Circle.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/elements/Circle.js')
-rw-r--r--src/elements/Circle.js10
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)
}
}