From a5d10fcf0f37815b60a226e9650f36b873859dd5 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Sat, 2 Nov 2019 12:54:39 +0100 Subject: [PATCH] limit expanding rings in special HOFs to 2 parameters --- HISTORY.md | 3 +++ snap.html | 2 +- src/blocks.js | 9 +++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 9f0571cb..d86d51cd 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -8,6 +8,9 @@ * **Translation Updates:** * German +### 2019-11-01 +* blocks: limit expanding rings in special HOFs to 2 parameters + ### 2019-11-01 * new dev version * expanding the rings in "map", "keep" and "find" shows 3 inputs named "item", "idx" and "data" diff --git a/snap.html b/snap.html index d1fe935a..d11c10ad 100755 --- a/snap.html +++ b/snap.html @@ -6,7 +6,7 @@ - + diff --git a/src/blocks.js b/src/blocks.js index ce0e9bbe..7da81a3f 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -148,7 +148,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2019-November-01'; +modules.blocks = '2019-November-02'; var SyntaxElementMorph; var BlockMorph; @@ -11016,8 +11016,9 @@ MultiArgMorph.prototype.fixArrowsLayout = function () { arrows = this.arrows(), leftArrow = arrows.children[0], rightArrow = arrows.children[1], + inpCount = this.inputs().length, dim = new Point(rightArrow.width() / 2, rightArrow.height()); - if (this.inputs().length < (this.minInputs + 1)) { + if (inpCount < (this.minInputs + 1)) { // hide left arrow if (label) { label.hide(); } @@ -11026,11 +11027,15 @@ MultiArgMorph.prototype.fixArrowsLayout = function () { arrows.position().subtract(new Point(dim.x, 0)) ); arrows.setExtent(dim); + } else if (this.is3ArgRingInHOF() && inpCount > 2) { // hide right arrow + rightArrow.hide(); + arrows.setExtent(dim); } else { if (label) { label.show(); } leftArrow.show(); + rightArrow.show(); rightArrow.setPosition(leftArrow.topCenter()); arrows.bounds.corner = rightArrow.bottomRight().copy(); }