aboutsummaryrefslogtreecommitdiffstats
path: root/src/types/PointArray.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2020-05-04 21:35:21 +1000
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2020-05-04 21:35:21 +1000
commitc8cb22863bf8c3ac157f6098be9154908aea9ec2 (patch)
treeb27b1bf6ec4c90bbd0cb335e26bb9ece504285d2 /src/types/PointArray.js
parent59f09a1a2317e57d13bbe8f60e1949cc82199ead (diff)
downloadsvg.js-c8cb22863bf8c3ac157f6098be9154908aea9ec2.tar.gz
svg.js-c8cb22863bf8c3ac157f6098be9154908aea9ec2.zip
Fixed IE Polyfills, got rid of ArrayPolyfill in favour of babels own transforms, updated dependencies, finished tests, removed old es5 tests
Diffstat (limited to 'src/types/PointArray.js')
-rw-r--r--src/types/PointArray.js26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/types/PointArray.js b/src/types/PointArray.js
index 54df08f..27a2076 100644
--- a/src/types/PointArray.js
+++ b/src/types/PointArray.js
@@ -1,15 +1,9 @@
import { delimiter } from '../modules/core/regex.js'
-import { extend } from '../utils/adopter.js'
-import { subClassArray } from './ArrayPolyfill.js'
import SVGArray from './SVGArray.js'
-import { Matrix } from '../main.js'
import Box from './Box.js'
+import Matrix from './Matrix.js'
-const PointArray = subClassArray('PointArray', SVGArray)
-
-export default PointArray
-
-extend(PointArray, {
+export default class PointArray extends SVGArray {
// Convert array to string
toString () {
// convert to a poly point string
@@ -18,7 +12,7 @@ extend(PointArray, {
}
return array.join(' ')
- },
+ }
// Convert array to line object
toLine () {
@@ -28,7 +22,7 @@ extend(PointArray, {
x2: this[1][0],
y2: this[1][1]
}
- },
+ }
// Parse point string and flat array
parse (array = [ 0, 0 ]) {
@@ -52,11 +46,11 @@ extend(PointArray, {
}
return points
- },
+ }
transform (m) {
return this.clone().transformO(m)
- },
+ }
// transform points with matrix (similar to Point.transform)
transformO (m) {
@@ -72,7 +66,7 @@ extend(PointArray, {
}
return this
- },
+ }
// Move point string
move (x, y) {
@@ -90,7 +84,7 @@ extend(PointArray, {
}
return this
- },
+ }
// Resize poly string
size (width, height) {
@@ -104,7 +98,7 @@ extend(PointArray, {
}
return this
- },
+ }
// Get bounding box of points
bbox () {
@@ -120,4 +114,4 @@ extend(PointArray, {
})
return new Box(minX, minY, maxX - minX, maxY - minY)
}
-})
+}