tweaked block highlights for fade-out

pull/95/head
jmoenig 2020-07-21 08:28:52 +02:00
rodzic 5d2e069a62
commit 6b3c137021
3 zmienionych plików z 14 dodań i 4 usunięć

Wyświetl plik

@ -2,6 +2,9 @@
## in development:
### 2020-07-21
* blocks: tweaked block highlights for fade-out
### 2020-07-20
* objects: fixed a list-watcher direct-editing offset bug
* morphic: update the Hand's position on mouse-down - avoid triggering at the origin point

Wyświetl plik

@ -7,7 +7,7 @@
<script src="src/morphic.js?version=2020-07-20"></script>
<script src="src/symbols.js?version=2020-07-20"></script>
<script src="src/widgets.js?version=2020-07-13"></script>
<script src="src/blocks.js?version=2020-07-20"></script>
<script src="src/blocks.js?version=2020-07-21"></script>
<script src="src/threads.js?version=2020-07-09"></script>
<script src="src/objects.js?version=2020-07-20"></script>
<script src="src/gui.js?version=2020-07-19"></script>

Wyświetl plik

@ -158,7 +158,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
// Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2020-July-20';
modules.blocks = '2020-July-21';
var SyntaxElementMorph;
var BlockMorph;
@ -785,6 +785,13 @@ SyntaxElementMorph.prototype.unflash = function () {
}
};
SyntaxElementMorph.prototype.doWithAlpha = function (alpha, callback) {
var current = this.alpha;
SyntaxElementMorph.prototype.alpha = alpha;
callback();
SyntaxElementMorph.prototype.alpha = current;
};
// SyntaxElementMorph zebra coloring
SyntaxElementMorph.prototype.fixBlockColor = function (
@ -4198,7 +4205,7 @@ BlockMorph.prototype.highlight = function (color, blur, border) {
BlockMorph.prototype.highlightImage = function (color, border) {
var fb, img, hi, ctx, out;
fb = this.fullBounds().extent();
img = this.fullImage();
this.doWithAlpha(1, () => img = this.fullImage());
hi = newCanvas(fb.add(border * 2));
ctx = hi.getContext('2d');
@ -4228,7 +4235,7 @@ BlockMorph.prototype.highlightImage = function (color, border) {
BlockMorph.prototype.highlightImageBlurred = function (color, blur) {
var fb, img, hi, ctx;
fb = this.fullBounds().extent();
img = this.fullImage();
this.doWithAlpha(1, () => img = this.fullImage());
hi = newCanvas(fb.add(blur * 2));
ctx = hi.getContext('2d');