From f557ddeb2ab692f5fbbc31b1e7724461a4565c97 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 7 Aug 2013 11:32:58 +0200 Subject: Fixed stage costume scaling & misplacing bug Thanks, Josh, for the report! --- gui.js | 6 +++++- history.txt | 1 + objects.js | 8 ++------ 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; -- cgit v1.3.1