summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-08-07 11:32:58 +0200
committerjmoenig <jens@moenig.org>2013-08-07 11:32:58 +0200
commitf557ddeb2ab692f5fbbc31b1e7724461a4565c97 (patch)
treede7f378d7da982a9987979c053ae518631423541
parente2320cae3d7e9a01ae60fb2bbb234c7940e1071a (diff)
downloadsnap-yow-f557ddeb2ab692f5fbbc31b1e7724461a4565c97.tar.gz
snap-yow-f557ddeb2ab692f5fbbc31b1e7724461a4565c97.zip
Fixed stage costume scaling & misplacing bug
Thanks, Josh, for the report!
-rw-r--r--gui.js6
-rwxr-xr-xhistory.txt1
-rw-r--r--objects.js8
3 files changed, 8 insertions, 7 deletions
diff --git a/gui.js b/gui.js
index f7e1237..7419ea7 100644
--- a/gui.js
+++ b/gui.js
@@ -4729,7 +4729,11 @@ SpriteIconMorph.prototype.createThumbnail = function () {
this.thumbnail = new Morph();
this.thumbnail.setExtent(this.thumbSize);
- this.thumbnail.image = this.object.fullThumbnail(this.thumbSize);
+ if (this.object instanceof SpriteMorph) { // support nested sprites
+ this.thumbnail.image = this.object.fullThumbnail(this.thumbSize);
+ } else {
+ this.thumbnail.image = this.object.thumbnail(this.thumbSize);
+ }
this.add(this.thumbnail);
};
diff --git a/history.txt b/history.txt
index 250ba81..2a9e0eb 100755
--- a/history.txt
+++ b/history.txt
@@ -1855,3 +1855,4 @@ ______
130807
------
* Objects, GUI: Sprite Nesting preliminaries
+* Objects: Fixed stage costume scaling & misplacing bug. Thanks, Josh, for the report!
diff --git a/objects.js b/objects.js
index 0a79cf7..e01494f 100644
--- a/objects.js
+++ b/objects.js
@@ -3551,8 +3551,8 @@ StageMorph.prototype.drawNew = function () {
ctx.scale(this.scale, this.scale);
ctx.drawImage(
this.costume.contents,
- (this.width() - this.costume.width() * this.scale) / 2,
- (this.height() - this.costume.height() * this.scale) / 2
+ (this.width() / this.scale - this.costume.width()) / 2,
+ (this.height() / this.scale - this.costume.height()) / 2
);
}
};
@@ -4426,10 +4426,6 @@ StageMorph.prototype.thumbnail = function (extentPoint, excludedSprite) {
return trg;
};
-StageMorph.prototype.fullThumbnail = function (extentPoint, excludedSprite) {
- return this.thumbnail(extentPoint, excludedSprite);
-};
-
// StageMorph cloning overrice
StageMorph.prototype.createClone = nop;