mirror of
https://github.com/konvajs/konva.git
synced 2025-04-30 09:41:47 +08:00
added setX and setY methods for convenience
This commit is contained in:
parent
4f36b27199
commit
30e8973956
14
dist/kinetic-core.js
vendored
14
dist/kinetic-core.js
vendored
@ -399,6 +399,20 @@ Kinetic.Node.prototype = {
|
|||||||
this.attrs.x = x;
|
this.attrs.x = x;
|
||||||
this.attrs.y = y;
|
this.attrs.y = y;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* set node x position
|
||||||
|
* @param {Number} x
|
||||||
|
*/
|
||||||
|
setX: function(x) {
|
||||||
|
this.attrs.x = x;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* set node y position
|
||||||
|
* @param {Number} y
|
||||||
|
*/
|
||||||
|
setY: function(y) {
|
||||||
|
this.attrs.y = y;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* get node position relative to container
|
* get node position relative to container
|
||||||
*/
|
*/
|
||||||
|
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
14
src/Node.js
14
src/Node.js
@ -250,6 +250,20 @@ Kinetic.Node.prototype = {
|
|||||||
this.attrs.x = x;
|
this.attrs.x = x;
|
||||||
this.attrs.y = y;
|
this.attrs.y = y;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* set node x position
|
||||||
|
* @param {Number} x
|
||||||
|
*/
|
||||||
|
setX: function(x) {
|
||||||
|
this.attrs.x = x;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* set node y position
|
||||||
|
* @param {Number} y
|
||||||
|
*/
|
||||||
|
setY: function(y) {
|
||||||
|
this.attrs.y = y;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* get node position relative to container
|
* get node position relative to container
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user