diff --git a/HISTORY.md b/HISTORY.md index c15d3718..9654d5d3 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,6 +6,7 @@ * specifying alpha values is now optional for generating pixels in bitmaps (costumes), none means the pixel is solid * new "add comment" option in the block context menu, thanks, Rob Fidler! * attribute selection in the SET block are now prefixed with "my" + * assume stage dimensions for "SWITCH TO COSTUME" with list if current costume dimensions don't fit * added "bar / lines" option for plotting charts in the "frequency distribution analysis" library * new "48 kHz" option in the "sampling rate" dropdown * **Notable Fixes:** @@ -18,6 +19,7 @@ * Greek translation updata, thanks, HM100! * blocks, threads: prefixed attribute selection in the SET block with "my" * German translation update +* objects: assume stage dimensions for "SWITCH TO COSTUME" with list if current costume dimensions don't fit ### 2020-10-04 * threads: made alpha values optional for generating costume pixels, none = solid diff --git a/snap.html b/snap.html index be53c224..60c26de2 100755 --- a/snap.html +++ b/snap.html @@ -10,7 +10,7 @@ - + diff --git a/src/objects.js b/src/objects.js index 16e5a68c..0bdb5d9c 100644 --- a/src/objects.js +++ b/src/objects.js @@ -84,7 +84,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, BooleanSlotMorph, localize, TableMorph, TableFrameMorph, normalizeCanvas, VectorPaintEditorMorph, HandleMorph, AlignmentMorph, Process, XML_Element, WorldMap, copyCanvas*/ -modules.objects = '2020-October-04'; +modules.objects = '2020-October-05'; var SpriteMorph; var StageMorph; @@ -3564,13 +3564,14 @@ SpriteMorph.prototype.doWearPreviousCostume = function () { }; SpriteMorph.prototype.doSwitchToCostume = function (id, noShadow) { - var w, h; + var w = 0, h = 0; if (id instanceof List) { // try to turn a list of pixels into a costume if (this.costume) { // recycle dimensions of current costume w = this.costume.width(); h = this.costume.height(); - } else { + } + if (w * h !== id.length()) { // assume stage's dimensions w = StageMorph.prototype.dimensions.x; h = StageMorph.prototype.dimensions.y;