added new stage.getIntersects() method which allows you to obtain all the shapes that intersect a given point. Also enhanced all methods that require an x or y by allowing either two arguments to be passed in or an object to be passed in. Example foo(100, 50) or foo({x:100, y:50});

This commit is contained in:
Eric Rowell
2012-04-27 23:57:01 -07:00
parent 192681374d
commit 9fef9e54d9
7 changed files with 124 additions and 21 deletions

View File

@@ -287,12 +287,12 @@ Kinetic.Node.prototype = {
},
/**
* set node position
* @param {Number} x
* @param {Number} y
* @param {Object} point
*/
setPosition: function(x, y) {
this.attrs.x = x;
this.attrs.y = y;
setPosition: function() {
var pos = Kinetic.GlobalObject._getPoint(arguments);
this.attrs.x = pos.x;
this.attrs.y = pos.y;
},
/**
* set node x position
@@ -353,7 +353,8 @@ Kinetic.Node.prototype = {
* @param {Object} pos object containing an x and
* y property
*/
setAbsolutePosition: function(pos) {
setAbsolutePosition: function() {
var pos = Kinetic.GlobalObject._getPoint(arguments);
/*
* save rotation and scale and
* then remove them from the transform