summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-12-01 14:57:30 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-12-01 14:57:30 +0100
commitdbe9c376fd76dd4e4777281888f4092e38512c18 (patch)
treeb56c3f5c974c1995da5d49556e8f6eaedbc8fd15
parent99074bd80815d944f5b9c4e388a4203560b0e69e (diff)
downloadsvg.js-dbe9c376fd76dd4e4777281888f4092e38512c18.tar.gz
svg.js-dbe9c376fd76dd4e4777281888f4092e38512c18.zip
add back move and dmove for groups
-rw-r--r--src/elements/G.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/elements/G.js b/src/elements/G.js
index 6a93a3f..398554a 100644
--- a/src/elements/G.js
+++ b/src/elements/G.js
@@ -6,6 +6,32 @@ export default class G extends Container {
constructor (node) {
super(nodeOrNew('g', node), node)
}
+
+ x (x) {
+ if (x == null) return this.transform()['x']
+ return this.move(x, 0)
+ }
+
+ y (y) {
+ if (y == null) return this.transform()['y']
+ return this.move(0, y)
+ }
+
+ move (x, y) {
+ return this.translate(x, y)
+ }
+
+ dx (dx) {
+ return this.transform({ dx }, true)
+ }
+
+ dy (dy) {
+ return this.transform({ dy }, true)
+ }
+
+ dmove (dx, dy) {
+ return this.transform({ dx, dy }, true)
+ }
}
registerMethods({