tweaked context visualizations to be alpha-independent

pull/95/head
jmoenig 2020-07-22 12:25:33 +02:00
rodzic 53e661b7ed
commit d2247c364b
4 zmienionych plików z 21 dodań i 16 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -8,7 +8,7 @@
<script src="src/symbols.js?version=2020-07-21"></script>
<script src="src/widgets.js?version=2020-07-21"></script>
<script src="src/blocks.js?version=2020-07-22"></script>
<script src="src/threads.js?version=2020-07-09"></script>
<script src="src/threads.js?version=2020-07-22"></script>
<script src="src/objects.js?version=2020-07-20"></script>
<script src="src/gui.js?version=2020-07-22"></script>
<script src="src/paint.js?version=2020-05-17"></script>

Wyświetl plik

@ -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 //////////////////////////////////////////////////////////

Wyświetl plik

@ -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: