Avoid dropping reporters into variadic inputs unless it touches the arrows

pull/3/merge
jmoenig 2013-07-30 10:35:37 +02:00
rodzic af5c688407
commit 20c1d4d14f
2 zmienionych plików z 21 dodań i 4 usunięć

Wyświetl plik

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

Wyświetl plik

@ -1822,4 +1822,9 @@ ______
130724
------
* Dutch translation, yay!! Thanks, Frank Sierens
* 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