Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/easeljs/display/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ this.createjs = this.createjs||{};
**/
p._getObjectsUnderPoint = function(x, y, arr, mouse, activeListener, currentDepth) {
currentDepth = currentDepth || 0;
if (!currentDepth && !this._testMask(this, x, y)) { return null; }
var hitMask = this._testMask(this, x, y);
if (!currentDepth && !hitMask) { return null; }
var mtx, ctx = createjs.DisplayObject._hitTestContext;
activeListener = activeListener || (mouse&&this._hasMouseEventListener());

Expand Down Expand Up @@ -626,6 +627,11 @@ this.createjs = this.createjs||{};
else { return (mouse && !this.mouseChildren) ? this : child; }
}
}

if (hitMask && this.mouseEnabled) {
if (arr) { arr.push(this); }
return this;
}
return null;
};

Expand All @@ -638,11 +644,11 @@ this.createjs = this.createjs||{};
* @protected
**/
p._testMask = function(target, x, y) {
var mask = target.mask;
var mask = target.mask || target;
if (!mask || !mask.graphics || mask.graphics.isEmpty()) { return true; }

var mtx = this._props.matrix, parent = target.parent;
mtx = parent ? parent.getConcatenatedMatrix(mtx) : mtx.identity();
var parent = target.parent;
var mtx = parent ? parent.getConcatenatedMatrix(this._props.matrix.clone()) : mtx.identity();
mtx = mask.getMatrix(mask._props.matrix).prependMatrix(mtx);

var ctx = createjs.DisplayObject._hitTestContext;
Expand Down