Implement Item#isInside(rect).

This commit is contained in:
Jürg Lehni 2014-10-20 16:51:28 +02:00
parent ad50e9f604
commit 4eb06f0849
2 changed files with 11 additions and 2 deletions

View file

@ -679,8 +679,8 @@ var Point = Base.extend(/** @lends Point# */{
* @param {Rectangle} rect the rectangle to check against
* @returns {Boolean} {@true if the point is inside the rectangle}
*/
isInside: function(rect) {
return rect.contains(this);
isInside: function(/* rect */) {
return Rectangle.read(arguments).contains(this);
},
/**

View file

@ -1625,6 +1625,15 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
return point.isInside(this.getInternalBounds());
},
// DOCS:
/**
* @param {Rectangle} rect the rectangle to check against
* @returns {Boolean}
*/
isInside: function(/* rect */) {
return Rectangle.read(arguments).contains(this.getBounds());
},
/**
* Perform a hit test on the item (and its children, if it is a
* {@link Group} or {@link Layer}) at the location of the specified point.