recolor block label shadows

pull/95/head
jmoenig 2020-02-17 15:53:46 +01:00
rodzic 4f6d4045ff
commit 71c376cdcc
1 zmienionych plików z 16 dodań i 10 usunięć

Wyświetl plik

@ -756,23 +756,29 @@ SyntaxElementMorph.prototype.dark = function () {
// SyntaxElementMorph color changing:
SyntaxElementMorph.prototype.setColor = function (aColor) { // ++++
SyntaxElementMorph.prototype.setColor = function (aColor) {
var block;
if (aColor) {
if (!this.color.eq(aColor)) {
block = this.parentThatIsA(BlockMorph);
this.color = aColor;
this.children.forEach(function (child) {
if ((!silently || child instanceof TemplateSlotMorph) &&
!(child instanceof BlockHighlightMorph)) {
child.drawNew();
child.changed();
}
});
if (block) {
this.children.forEach(morph => {
if (morph instanceof StringMorph ||
morph instanceof SymbolMorph) {
morph.shadowColor = block.color.darker(
block.labelContrast
);
morph.rerender();
}
});
}
this.rerender();
}
}
};
}
SyntaxElementMorph.prototype.setLabelColor = function (
SyntaxElementMorph.prototype.setLabelColor = function ( // +++ review this
textColor,
shadowColor,
shadowOffset