summaryrefslogtreecommitdiff
path: root/threads.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-12-03 12:48:31 +0100
committerjmoenig <jens@moenig.org>2014-12-03 12:48:31 +0100
commit17b6ae839b5c15c942440f38fc07bfcc45bc0811 (patch)
treefabea790fbe8978d1647c958a6e226b87f5feb72 /threads.js
parentd94d9ff4e85b50ce57e4c62d63250994c4b9b4c7 (diff)
downloadsnap-yow-17b6ae839b5c15c942440f38fc07bfcc45bc0811.tar.gz
snap-yow-17b6ae839b5c15c942440f38fc07bfcc45bc0811.zip
Improve edge-collision detection of default sprite “arrow” shape
Diffstat (limited to 'threads.js')
-rw-r--r--threads.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/threads.js b/threads.js
index 59dd23a..9f9a221 100644
--- a/threads.js
+++ b/threads.js
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff ////////////////////////////////////////////////////////
-modules.threads = '2014-November-26';
+modules.threads = '2014-December-03';
var ThreadManager;
var Process;
@@ -2368,6 +2368,7 @@ Process.prototype.objectTouchingObject = function (thisObj, name) {
var myself = this,
those,
stage,
+ box,
mouse;
if (this.inputOption(name) === 'mouse-pointer') {
@@ -2379,9 +2380,14 @@ Process.prototype.objectTouchingObject = function (thisObj, name) {
} else {
stage = thisObj.parentThatIsA(StageMorph);
if (stage) {
- if (this.inputOption(name) === 'edge' &&
- !stage.bounds.containsRectangle(thisObj.bounds)) {
- return true;
+ if (this.inputOption(name) === 'edge') {
+ box = thisObj.bounds;
+ if (!thisObj.costume && thisObj.penBounds) {
+ box = thisObj.penBounds.translateBy(thisObj.position());
+ }
+ if (!stage.bounds.containsRectangle(box)) {
+ return true;
+ }
}
if (this.inputOption(name) === 'pen trails' &&
thisObj.isTouching(stage.penTrailsMorph())) {