diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2023-09-03 11:33:51 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2023-09-03 11:33:51 +0200 |
commit | 46ee87a1c2fc373c629235010c05bd8d40b2cb9e (patch) | |
tree | f33a887ef31e260fd01da43e7a6fff3627677deb | |
parent | 742394edf6777292d1db55baa6cfb33f686e0f21 (diff) | |
download | svg.js-46ee87a1c2fc373c629235010c05bd8d40b2cb9e.tar.gz svg.js-46ee87a1c2fc373c629235010c05bd8d40b2cb9e.zip |
added amove methods to runner (fixes #1131)
-rw-r--r-- | src/animation/Runner.js | 12 | ||||
-rw-r--r-- | svg.js.d.ts | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/animation/Runner.js b/src/animation/Runner.js index 4ad222f..8fd4b8b 100644 --- a/src/animation/Runner.js +++ b/src/animation/Runner.js @@ -899,6 +899,14 @@ extend(Runner, { return this._queueNumber('y', y) }, + ax(x) { + return this._queueNumber('ax', x) + }, + + ay(y) { + return this._queueNumber('ay', y) + }, + dx(x = 0) { return this._queueNumberDelta('x', x) }, @@ -980,6 +988,10 @@ extend(Runner, { return this.x(x).y(y) }, + amove(x, y) { + return this.ax(x).ay(y) + }, + // Add animatable center center(x, y) { return this.cx(x).cy(y) diff --git a/svg.js.d.ts b/svg.js.d.ts index 520ae98..37ee526 100644 --- a/svg.js.d.ts +++ b/svg.js.d.ts @@ -1019,12 +1019,15 @@ declare module '@svgdotjs/svg.js' { ): this x(x: number): this y(y: number): this + ax(x: number): this + ay(y: number): this dx(dx: number): this dy(dy: number): this cx(x: number): this cy(y: number): this dmove(dx: number, dy: number): this move(x: number, y: number): this + amove(x: number, y: number): this center(x: number, y: number): this size(width: number, height: number): this width(width: number): this |