diff options
| author | jmoenig <jens@moenig.org> | 2013-07-30 10:35:37 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-07-30 10:35:37 +0200 |
| commit | 20c1d4d14f3dfb6a50d6d1be3dc47a4ca9cf5921 (patch) | |
| tree | 1fcb54142e63728044d1ca1c2e188094226d811f | |
| parent | af5c688407ee2bcb0e08993db34a0635af6c06a5 (diff) | |
| download | snap-yow-20c1d4d14f3dfb6a50d6d1be3dc47a4ca9cf5921.tar.gz snap-yow-20c1d4d14f3dfb6a50d6d1be3dc47a4ca9cf5921.zip | |
Avoid dropping reporters into variadic inputs unless it touches the arrows
| -rw-r--r-- | blocks.js | 18 | ||||
| -rwxr-xr-x | history.txt | 7 |
2 files changed, 21 insertions, 4 deletions
@@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2013-July-15'; +modules.blocks = '2013-July-30'; var SyntaxElementMorph; var BlockMorph; @@ -4575,6 +4575,16 @@ ScriptsMorph.prototype.closestInput = function (reporter, hand) { }); if (all.length === 0) {return null; } + function touchingVariadicArrowsIfAny(inp, point) { + if (inp instanceof MultiArgMorph) { + if (point) { + return inp.arrows().bounds.containsPoint(point); + } + return inp.arrows().bounds.intersects(fb); + } + return true; + } + if (this.isPreferringEmptySlots) { if (hand) { handPos = hand.position(); @@ -4588,7 +4598,8 @@ ScriptsMorph.prototype.closestInput = function (reporter, hand) { || input.isEmptySlot()) && !input.isLocked() && input.bounds.containsPoint(handPos) - && !contains(blackList, input); + && !contains(blackList, input) + && touchingVariadicArrowsIfAny(input, handPos); } ); if (target) { @@ -4605,7 +4616,8 @@ ScriptsMorph.prototype.closestInput = function (reporter, hand) { || input.isEmptySlot()) && !input.isLocked() && input.bounds.intersects(fb) - && !contains(blackList, input); + && !contains(blackList, input) + && touchingVariadicArrowsIfAny(input); } ); if (target) { diff --git a/history.txt b/history.txt index a28da7d..593c1cd 100755 --- a/history.txt +++ b/history.txt @@ -1822,4 +1822,9 @@ ______ 130724 ------ -* Dutch translation, yay!! Thanks, Frank Sierens
\ No newline at end of file +* Dutch translation, yay!! Thanks, Frank Sierens + +130730 +------ +* Blocks: Made it harder to drop reporters on the variadic input per se (as opposed to into one of its slots) in (default) "prefer empty slot drops" setting + |
