From 9a67cc3bbaf2e3f83368dc9706a06ec245a22c6a Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 8 Apr 2020 11:07:53 +1000 Subject: added tests for Circle --- src/main.js | 5 ++--- src/modules/optional/sugar.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src') 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) } }) -- cgit v1.2.3