diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2021-01-13 17:26:33 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2021-01-13 17:26:33 +0100 |
commit | 4524c20b48abe08e69c25a7382a289592d147496 (patch) | |
tree | 3e475fe673d5acd800180282e84df03d396106f3 /src/modules/optional/transform.js | |
parent | 4f4dc2afa62cb899a5cae72c359150f8adf27edb (diff) | |
download | svg.js-4524c20b48abe08e69c25a7382a289592d147496.tar.gz svg.js-4524c20b48abe08e69c25a7382a289592d147496.zip |
update dependencies, apply new linter fixes
Diffstat (limited to 'src/modules/optional/transform.js')
-rw-r--r-- | src/modules/optional/transform.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/optional/transform.js b/src/modules/optional/transform.js index 68455ed..d8e7381 100644 --- a/src/modules/optional/transform.js +++ b/src/modules/optional/transform.js @@ -10,11 +10,11 @@ export function untransform () { // merge the whole transformation chain into one matrix and returns it export function matrixify () { - var matrix = (this.attr('transform') || '') + const matrix = (this.attr('transform') || '') // split transformations .split(transforms).slice(0, -1).map(function (str) { // generate key => value pairs - var kv = str.trim().split('(') + const kv = str.trim().split('(') return [ kv[0], kv[1].split(delimiter) .map(function (str) { @@ -37,8 +37,8 @@ export function matrixify () { // add an element to another parent without changing the visual representation on the screen export function toParent (parent, i) { if (this === parent) return this - var ctm = this.screenCTM() - var pCtm = parent.screenCTM().inverse() + const ctm = this.screenCTM() + const pCtm = parent.screenCTM().inverse() this.addTo(parent, i).untransform().transform(pCtm.multiply(ctm)) @@ -54,7 +54,7 @@ export function toRoot (i) { export function transform (o, relative) { // Act as a getter if no object was passed if (o == null || typeof o === 'string') { - var decomposed = new Matrix(this).decompose() + const decomposed = new Matrix(this).decompose() return o == null ? decomposed : decomposed[o] } @@ -64,8 +64,8 @@ export function transform (o, relative) { } // The user can pass a boolean, an Element or an Matrix or nothing - var cleanRelative = relative === true ? this : (relative || false) - var result = new Matrix(cleanRelative).transform(o) + const cleanRelative = relative === true ? this : (relative || false) + const result = new Matrix(cleanRelative).transform(o) return this.attr('transform', result) } |