From 6cebf3bf0e5d3cade7b0a7dc9c8feb191b2eb91f Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Thu, 8 Nov 2018 12:04:13 +0100 Subject: size function of circle now only accepts one argument (#788) --- src/elements/Circle.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/elements/Circle.js') 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) } } -- cgit v1.2.3