aboutsummaryrefslogtreecommitdiffstats
path: root/src/types/Box.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2021-01-13 17:26:33 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2021-01-13 17:26:33 +0100
commit4524c20b48abe08e69c25a7382a289592d147496 (patch)
tree3e475fe673d5acd800180282e84df03d396106f3 /src/types/Box.js
parent4f4dc2afa62cb899a5cae72c359150f8adf27edb (diff)
downloadsvg.js-4524c20b48abe08e69c25a7382a289592d147496.tar.gz
svg.js-4524c20b48abe08e69c25a7382a289592d147496.zip
update dependencies, apply new linter fixes
Diffstat (limited to 'src/types/Box.js')
-rw-r--r--src/types/Box.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/types/Box.js b/src/types/Box.js
index 71d1e2a..f8976d4 100644
--- a/src/types/Box.js
+++ b/src/types/Box.js
@@ -34,13 +34,18 @@ export default class Box {
}
init (source) {
- var base = [ 0, 0, 0, 0 ]
- source = typeof source === 'string' ? source.split(delimiter).map(parseFloat)
- : Array.isArray(source) ? source
- : typeof source === 'object' ? [ source.left != null ? source.left
- : source.x, source.top != null ? source.top : source.y, source.width, source.height ]
- : arguments.length === 4 ? [].slice.call(arguments)
- : base
+ const base = [ 0, 0, 0, 0 ]
+ source = typeof source === 'string'
+ ? source.split(delimiter).map(parseFloat)
+ : Array.isArray(source)
+ ? source
+ : typeof source === 'object'
+ ? [ source.left != null
+ ? source.left
+ : source.x, source.top != null ? source.top : source.y, source.width, source.height ]
+ : arguments.length === 4
+ ? [].slice.call(arguments)
+ : base
this.x = source[0] || 0
this.y = source[1] || 0