summaryrefslogtreecommitdiff
path: root/objects.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 /objects.js
parentd94d9ff4e85b50ce57e4c62d63250994c4b9b4c7 (diff)
downloadsnap-17b6ae839b5c15c942440f38fc07bfcc45bc0811.tar.gz
snap-17b6ae839b5c15c942440f38fc07bfcc45bc0811.zip
Improve edge-collision detection of default sprite “arrow” shape
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/objects.js b/objects.js
index f0fe942..4ad376c 100644
--- a/objects.js
+++ b/objects.js
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2014-December-01';
+modules.objects = '2014-December-03';
var SpriteMorph;
var StageMorph;
@@ -3238,8 +3238,11 @@ SpriteMorph.prototype.setCenter = function (aPoint, justMe) {
SpriteMorph.prototype.nestingBounds = function () {
// same as fullBounds(), except that it uses "parts" instead of children
- var result;
- result = this.bounds;
+ // and special cases the costume-less "arrow" shape's bounding box
+ var result = this.bounds;
+ if (!this.costume && this.penBounds) {
+ result = this.penBounds.translateBy(this.position());
+ }
this.parts.forEach(function (part) {
if (part.isVisible) {
result = result.merge(part.nestingBounds());