From 02ce2b9049509c54ad9be36b9d234db794aed748 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 29 Jul 2020 21:41:17 +0200 Subject: [PATCH] added "hole" to stack-highlights to enable clicking inside open areas --- HISTORY.md | 4 ++++ snap.html | 2 +- src/blocks.js | 9 ++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 79c69877..6876b0ea 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -28,11 +28,15 @@ * fixed numeric input fields in dialog boxes * fixed reacting to keyboard input in dialog boxes * fixed zoom blocks type-in dialog + * added "hole" to stack-highlights to enable clicking inside open areas * **Documentation Updates:** * added migration guide for Morphic2/Snap!6 * **Translation Updates:** * German +### 2020-07-29 +* blocks: added "hole" to stack-highlights to enable clicking inside open areas + ### 2020-07-28 * blocks: tweaked stack-highlight for (partially) faded blocks diff --git a/snap.html b/snap.html index 8f24a894..ffec3eb9 100755 --- a/snap.html +++ b/snap.html @@ -7,7 +7,7 @@ - + diff --git a/src/blocks.js b/src/blocks.js index 5b9383da..b500a89b 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -158,7 +158,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2020-July-28'; +modules.blocks = '2020-July-29'; var SyntaxElementMorph; var BlockMorph; @@ -4217,13 +4217,16 @@ BlockMorph.prototype.highlight = function (color, blur, border) { var highlight = new BlockHighlightMorph(), fb = this.fullBounds(), edge = useBlurredShadows && !MorphicPreferences.isFlat ? - blur : border; + blur : border, + offset = new Point(edge, edge); + highlight.bounds.setExtent(fb.extent().add(edge * 2)); + highlight.holes = [fb.translateBy(this.position().neg().add(offset))]; highlight.color = color; highlight.cachedImage = useBlurredShadows && !MorphicPreferences.isFlat ? this.highlightImageBlurred(color, blur) : this.highlightImage(color, border); - highlight.setPosition(fb.origin.subtract(new Point(edge, edge))); + highlight.setPosition(fb.origin.subtract(offset)); return highlight; };