diff --git a/HISTORY.md b/HISTORY.md index 54fe11fa..15805177 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,6 +4,7 @@ ### 2020-07-22 * morphic, blocks, gui: tweaked block-fading mouse-over +* blocks, threads: tweaked context visualizations to be alpha-independent ### 2020-07-21 * blocks: tweaked block highlights for fade-out diff --git a/snap.html b/snap.html index 12664093..5b649211 100755 --- a/snap.html +++ b/snap.html @@ -8,7 +8,7 @@ - + diff --git a/src/blocks.js b/src/blocks.js index a751b223..ff21b135 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -786,10 +786,12 @@ SyntaxElementMorph.prototype.unflash = function () { }; SyntaxElementMorph.prototype.doWithAlpha = function (alpha, callback) { - var current = SyntaxElementMorph.prototype.alpha; + var current = SyntaxElementMorph.prototype.alpha, + result; SyntaxElementMorph.prototype.alpha = alpha; - callback(); + result = callback(); SyntaxElementMorph.prototype.alpha = current; + return result; }; // SyntaxElementMorph zebra coloring @@ -2329,20 +2331,22 @@ function BlockLabelMorph( fontName ); } - BlockLabelMorph.prototype.getRenderColor = function () { + var block = this.parentThatIsA(BlockMorph); if (MorphicPreferences.isFlat) { - return this.parent.alpha > 0.4 ? this.color - : (this.parent.alpha > 0.2 ? BLACK - : this.parent.color.solid()); + return block.alpha > 0.4 ? this.color + : (block.alpha > 0.2 ? BLACK + : block.color.solid()); } - return this.parent.alpha > 0.4 ? this.color - : (this.parent.alpha > 0.2 ? WHITE - : this.parent.color.solid()); + return block.alpha > 0.4 ? this.color + : (block.alpha > 0.2 ? WHITE + : block.color.solid()); }; BlockLabelMorph.prototype.getShadowRenderColor = function () { - return this.parent.alpha > 0.6 ? this.shadowColor : CLEAR; + return this.parentThatIsA(BlockMorph).alpha > 0.6 ? + this.shadowColor + : CLEAR; }; // BlockSymbolMorph ////////////////////////////////////////////////////////// diff --git a/src/threads.js b/src/threads.js index 98b34b43..adb0b126 100644 --- a/src/threads.js +++ b/src/threads.js @@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy, Map, isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, BLACK, TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume*/ -modules.threads = '2020-July-09'; +modules.threads = '2020-July-22'; var ThreadManager; var Process; @@ -6114,15 +6114,15 @@ Context.prototype.image = function () { } } ring.embed(block, this.inputs); - return ring.fullImage(); + return ring.doWithAlpha(1, () => ring.fullImage()); } if (this.expression instanceof Array) { block = this.expression[this.pc].fullCopy(); if (block instanceof RingMorph && !block.contents()) { // empty ring - return block.fullImage(); + return block.doWithAlpha(1, () => block.fullImage()); } ring.embed(block, this.isContinuation ? [] : this.inputs); - return ring.fullImage(); + return ring.doWithAlpha(1, () => ring.fullImage()); } // otherwise show an empty ring @@ -6135,7 +6135,7 @@ Context.prototype.image = function () { ring.parts()[1].addInput(inp) ); } - return ring.fullImage(); + return ring.doWithAlpha(1, () => ring.fullImage()); }; // Context continuations: