diff --git a/HISTORY.md b/HISTORY.md index 39464c25..d71f8bee 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -86,6 +86,9 @@ * German * French +### 2019-06-04 +* Objects, Lists: fixed #682 + ### 2019-06-03 * Threads: fixed #2249, predicates inside generic WHEN hats should be able to pass upvars * Blocks: fixed #1740 diff --git a/snap.html b/snap.html index 1fd74d92..ce853863 100755 --- a/snap.html +++ b/snap.html @@ -8,10 +8,10 @@ - + - + diff --git a/src/lists.js b/src/lists.js index 73e685c4..8cfdaaa6 100644 --- a/src/lists.js +++ b/src/lists.js @@ -60,9 +60,9 @@ Color, Point, WatcherMorph, StringMorph, SpriteMorph, ScrollFrameMorph, CellMorph, ArrowMorph, MenuMorph, snapEquals, Morph, isNil, localize, isString, MorphicPreferences, TableDialogMorph, SpriteBubbleMorph, SpeechBubbleMorph, -TableFrameMorph, TableMorph, Variable, isSnapObject*/ +TableFrameMorph, TableMorph, Variable, isSnapObject, Costume*/ -modules.lists = '2019-April-27'; +modules.lists = '2019-June-04'; var List; var ListWatcherMorph; @@ -677,12 +677,12 @@ ListWatcherMorph.prototype.init = function (list, parentCell) { ListWatcherMorph.prototype.update = function (anyway) { var i, idx, ceil, morphs, cell, cnts, label, button, max, starttime, maxtime = 1000; - this.frame.contents.children.forEach(function (m) { if (m instanceof CellMorph) { if (m.contentsMorph instanceof ListWatcherMorph) { m.contentsMorph.update(); - } else if (isSnapObject(m.contents)) { + } else if (isSnapObject(m.contents) || + (m.contents instanceof Costume)) { m.update(); } } diff --git a/src/objects.js b/src/objects.js index 7fb8fa36..4c1091ef 100644 --- a/src/objects.js +++ b/src/objects.js @@ -84,7 +84,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize, TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph, AlignmentMorph, Process, XML_Element, VectorPaintEditorMorph, WorldMap*/ -modules.objects = '2019-June-02'; +modules.objects = '2019-June-04'; var SpriteMorph; var StageMorph; @@ -10381,11 +10381,12 @@ CellMorph.prototype.fixLayout = function () { CellMorph.prototype.update = function () { // special case for observing sprites - if (!isSnapObject(this.contents)) { + if (!isSnapObject(this.contents) && !(this.contents instanceof Costume)) { return; } if (this.version !== this.contents.version) { this.drawNew(); + this.version = this.contents.version; } }; @@ -10836,7 +10837,8 @@ WatcherMorph.prototype.update = function () { } } if (newValue !== this.currentValue || - isInherited !== this.isGhosted) { + isInherited !== this.isGhosted || + (newValue.version && (newValue.version !== this.version))) { this.changed(); this.cellMorph.contents = newValue; this.isGhosted = isInherited; @@ -10853,6 +10855,11 @@ WatcherMorph.prototype.update = function () { this.sliderMorph.drawNew(); } this.fixLayout(); + if (this.currentValue && this.currentValue.version) { + this.version = this.currentValue.version; + } else { + this.version = Date.now(); + } this.currentValue = newValue; } }