summaryrefslogtreecommitdiffstats
path: root/src/elements/G.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/elements/G.js')
-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({