diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-08 11:07:53 +1000 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-08 11:07:53 +1000 |
commit | 9a67cc3bbaf2e3f83368dc9706a06ec245a22c6a (patch) | |
tree | f9a4c38b668577117d7833a308c7868580d10617 /src | |
parent | e4e7e11da50c8129bcf31de03a2849f323aa4299 (diff) | |
download | svg.js-9a67cc3bbaf2e3f83368dc9706a06ec245a22c6a.tar.gz svg.js-9a67cc3bbaf2e3f83368dc9706a06ec245a22c6a.zip |
added tests for Circle
Diffstat (limited to 'src')
-rw-r--r-- | src/main.js | 5 | ||||
-rw-r--r-- | src/modules/optional/sugar.js | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/main.js b/src/main.js index 12ebc7b..a8da19f 100644 --- a/src/main.js +++ b/src/main.js @@ -10,7 +10,6 @@ import './modules/optional/transform.js' import { extend, makeInstance } from './utils/adopter.js' import { getMethodNames, getMethodsFor } from './utils/methods.js' import Box from './types/Box.js' -import Circle from './elements/Circle.js' import Color from './types/Color.js' import Container from './elements/Container.js' import Defs from './elements/Defs.js' @@ -148,8 +147,8 @@ extend([ extend([ Rect, Ellipse, - Circle, - Gradient + Gradient, + Runner ], getMethodsFor('radius')) extend(EventTarget, getMethodsFor('EventTarget')) diff --git a/src/modules/optional/sugar.js b/src/modules/optional/sugar.js index 0de2c04..72c02ca 100644 --- a/src/modules/optional/sugar.js +++ b/src/modules/optional/sugar.js @@ -104,11 +104,11 @@ registerMethods([ 'Element', 'Runner' ], { registerMethods('radius', { // Add x and y radius - radius: function (x, y) { + radius: function (x, y = x) { var type = (this._element || this).type return type === 'radialGradient' || type === 'radialGradient' ? this.attr('r', new SVGNumber(x)) - : this.rx(x).ry(y == null ? x : y) + : this.rx(x).ry(y) } }) |