aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/core/pointed.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-07 15:08:41 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-07 15:08:41 +0100
commit47fda3cf67cdc8ab20d3b1ba9d65a810adddf5ee (patch)
treec3dbd5df7f41c41ae5b41717ee8312ba84aeed07 /src/modules/core/pointed.js
parent23595eba0ee68a86040d4667bdae4d9e6fe426ba (diff)
parent0cae4172fa0c7ee9b876b1cf2b38ea8be66d3584 (diff)
downloadsvg.js-47fda3cf67cdc8ab20d3b1ba9d65a810adddf5ee.tar.gz
svg.js-47fda3cf67cdc8ab20d3b1ba9d65a810adddf5ee.zip
Merge branch '875-es6' into 3.0.0
Diffstat (limited to 'src/modules/core/pointed.js')
-rw-r--r--src/modules/core/pointed.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/modules/core/pointed.js b/src/modules/core/pointed.js
new file mode 100644
index 0000000..95e6819
--- /dev/null
+++ b/src/modules/core/pointed.js
@@ -0,0 +1,25 @@
+import PointArray from '../../types/PointArray.js'
+
+export let MorphArray = PointArray
+
+// Move by left top corner over x-axis
+export function x (x) {
+ return x == null ? this.bbox().x : this.move(x, this.bbox().y)
+}
+
+// Move by left top corner over y-axis
+export function y (y) {
+ return y == null ? this.bbox().y : this.move(this.bbox().x, y)
+}
+
+// Set width of element
+export function width (width) {
+ let b = this.bbox()
+ return width == null ? b.width : this.size(width, b.height)
+}
+
+// Set height of element
+export function height (height) {
+ let b = this.bbox()
+ return height == null ? b.height : this.size(b.width, height)
+}