diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2023-06-13 01:43:37 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2023-06-13 01:43:37 +0200 |
commit | 03322672782a6318b019eff33fe44ec800d6f12c (patch) | |
tree | 9d807e1585cf28a1ea98e87b855932dba00f1880 /src/elements/Circle.js | |
parent | 8e18b4698edd00f83af0be05bb3374f92fecaeb9 (diff) | |
download | svg.js-03322672782a6318b019eff33fe44ec800d6f12c.tar.gz svg.js-03322672782a6318b019eff33fe44ec800d6f12c.zip |
dependency updates, easier formatting
Diffstat (limited to 'src/elements/Circle.js')
-rw-r--r-- | src/elements/Circle.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/elements/Circle.js b/src/elements/Circle.js index 6981b05..5dae51e 100644 --- a/src/elements/Circle.js +++ b/src/elements/Circle.js @@ -10,25 +10,25 @@ import SVGNumber from '../types/SVGNumber.js' import Shape from './Shape.js' export default class Circle extends Shape { - constructor (node, attrs = node) { + constructor(node, attrs = node) { super(nodeOrNew('circle', node), attrs) } - radius (r) { + radius(r) { return this.attr('r', r) } // Radius x value - rx (rx) { + rx(rx) { return this.attr('r', rx) } // Alias radius x value - ry (ry) { + ry(ry) { return this.rx(ry) } - size (size) { + size(size) { return this.radius(new SVGNumber(size).divide(2)) } } @@ -39,9 +39,7 @@ registerMethods({ Container: { // Create circle element circle: wrapWithAttrCheck(function (size = 0) { - return this.put(new Circle()) - .size(size) - .move(0, 0) + return this.put(new Circle()).size(size).move(0, 0) }) } }) |