summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Dinsmore <nathan@users.noreply.github.com>2015-06-18 15:33:44 -0400
committerNathan Dinsmore <nathan@users.noreply.github.com>2015-06-18 15:33:44 -0400
commitbc79cd8df2b6c62a80bb6850697d368cf9acebd5 (patch)
tree74085497fdf42472959b5a45d0ffe7bccfe265e3
parentbae22f08044f01adba15608d3885e84e173c8889 (diff)
downloadsnap-bc79cd8df2b6c62a80bb6850697d368cf9acebd5.tar.gz
snap-bc79cd8df2b6c62a80bb6850697d368cf9acebd5.zip
Call isTransparentAt
-rw-r--r--morphic.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/morphic.js b/morphic.js
index 01220d5..aa731ab 100644
--- a/morphic.js
+++ b/morphic.js
@@ -9312,7 +9312,7 @@ Morph.prototype.topMorphAt = function (p) {
var result = c[i].topMorphAt(p);
if (result) return result;
}
- return this.bounds.containsPoint(p) ? this : null;
+ return this.bounds.containsPoint(p) && (this.noticesTransparentClick || !this.isTransparentAt(p)) ? this : null;
};
FrameMorph.prototype.topMorphAt = function (p) {
if (!(this.isVisible && this.bounds.containsPoint(p))) return null;
@@ -9320,13 +9320,13 @@ FrameMorph.prototype.topMorphAt = function (p) {
var result = c[i].topMorphAt(p);
if (result) return result;
}
- return this;
+ return this.noticesTransparentClick || !this.isTransparentAt(p) ? this : null;
};
ShadowMorph.prototype.topMorphAt = function () {
return null;
};
HandMorph.prototype.morphAtPointer = function () {
- return this.world.topMorphAt(this.bounds.origin);
+ return this.world.topMorphAt(this.bounds.origin) || this.world;
};
/*
@@ -9913,6 +9913,7 @@ WorldMorph.prototype.init = function (aCanvas, fillPage) {
this.isDraggable = false;
this.currentKey = null; // currently pressed key code
this.worldCanvas = aCanvas;
+ this.noticesTransparentClick = true;
// additional properties:
this.stamp = Date.now(); // reference in multi-world setups