Skip to content

Commit 0700d6e

Browse files
committed
fix root cause of clamp adjustment error
1 parent 759e96b commit 0700d6e

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

js/activity.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,10 +2409,6 @@ function Activity() {
24092409
textMsg("Alt-E " + _("Erase"));
24102410
_allClear(false);
24112411
break;
2412-
case 79: // 'O'
2413-
textMsg("Alt-O" + _("Reload Blocks"));
2414-
blocks._cleanupStacks();
2415-
break;
24162412
case 82: // 'R'
24172413
textMsg("Alt-R " + _("Play"));
24182414
that._doFastButton();

js/blocks.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
%
12
// Copyright (c) 2014-19 Walter Bender
23
//
34
// This program is free software; you can redistribute it and/or
@@ -1540,8 +1541,8 @@ function Blocks(activity) {
15401541
* need to check to see if we need to rename it.
15411542
* (7) Is it the name of a storein block? In which case we
15421543
* need to check to see if we need to add a palette entry.
1543-
* (8) Is it a case or default block? We need to make sure that
1544-
* they are inside a switch block.
1544+
* (8) Is it a case or default block? We need to make sure that
1545+
* they are inside a switch block.
15451546
* (9) And we need to recheck if it inside of a expandable block.
15461547
*/
15471548
var initialTopBlock = this.findTopBlock(thisBlock);
@@ -6793,12 +6794,14 @@ function Blocks(activity) {
67936794
this._cleanupStacks = function() {
67946795
// Sort the blocks from inside to outside.
67956796
let blocksToCheck = [];
6796-
for (let b = 0; b < this._checkArgClampBlocks.length; b++) {
6797-
blocksToCheck.push([b, this._getNestingDepth(b), '1arg']);
6797+
for (let b = 0; b < this._checkArgClampBlocks.length; b++) {
6798+
let bb = this._checkArgClampBlocks[b];
6799+
blocksToCheck.push([bb, this._getNestingDepth(bb), '1arg']);
67986800
}
67996801

68006802
for (let b = 0; b < this._checkTwoArgBlocks.length; b++) {
6801-
blocksToCheck.push([b, this._getNestingDepth(b), '2arg']);
6803+
let bb = this._checkTwoArgBlocks[b];
6804+
blocksToCheck.push([bb, this._getNestingDepth(bb), '2arg']);
68026805
}
68036806

68046807
blocksToCheck = blocksToCheck.sort(function(a, b) {
@@ -6811,7 +6814,7 @@ function Blocks(activity) {
68116814
if (blocksToCheck[i][2] === '1arg') {
68126815
this._adjustArgClampBlock([blocksToCheck[i][0]]);
68136816
} else {
6814-
// this._adjustExpandableTwoArgBlock([blocksToCheck[i][0]]);
6817+
this._adjustExpandableTwoArgBlock([blocksToCheck[i][0]]);
68156818
}
68166819
}
68176820

0 commit comments

Comments
 (0)