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/Gradient.js | |
parent | 8e18b4698edd00f83af0be05bb3374f92fecaeb9 (diff) | |
download | svg.js-03322672782a6318b019eff33fe44ec800d6f12c.tar.gz svg.js-03322672782a6318b019eff33fe44ec800d6f12c.zip |
dependency updates, easier formatting
Diffstat (limited to 'src/elements/Gradient.js')
-rw-r--r-- | src/elements/Gradient.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/elements/Gradient.js b/src/elements/Gradient.js index d3fa15b..1631c14 100644 --- a/src/elements/Gradient.js +++ b/src/elements/Gradient.js @@ -11,7 +11,7 @@ import baseFind from '../modules/core/selector.js' import * as gradiented from '../modules/core/gradiented.js' export default class Gradient extends Container { - constructor (type, attrs) { + constructor(type, attrs) { super( nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type), attrs @@ -19,26 +19,26 @@ export default class Gradient extends Container { } // custom attr to handle transform - attr (a, b, c) { + attr(a, b, c) { if (a === 'transform') a = 'gradientTransform' return super.attr(a, b, c) } - bbox () { + bbox() { return new Box() } - targets () { + targets() { return baseFind('svg [fill*=' + this.id() + ']') } // Alias string conversion to fill - toString () { + toString() { return this.url() } // Update gradient - update (block) { + update(block) { // remove all stops this.clear() @@ -51,7 +51,7 @@ export default class Gradient extends Container { } // Return the fill id - url () { + url() { return 'url(#' + this.id() + ')' } } @@ -61,7 +61,7 @@ extend(Gradient, gradiented) registerMethods({ Container: { // Create gradient element in defs - gradient (...args) { + gradient(...args) { return this.defs().gradient(...args) } }, |