mirror of
https://github.com/scratchfoundation/scratch-flash.git
synced 2024-12-04 21:21:06 -05:00
Merge pull request #278 from nathan/rename-variable-fix-layout
Fixed blocks not resizing when renaming variables
This commit is contained in:
commit
35b5563bb7
2 changed files with 10 additions and 3 deletions
|
@ -693,7 +693,10 @@ public class BlockMenus implements DragClient {
|
|||
}
|
||||
if (blockArg != null) blockArg.setArgValue(newName);
|
||||
if (block != null) {
|
||||
if (block.op == Specs.GET_VAR) block.setSpec(newName);
|
||||
if (block.op == Specs.GET_VAR) {
|
||||
block.setSpec(newName);
|
||||
block.fixExpressionLayout();
|
||||
}
|
||||
}
|
||||
Scratch.app.setSaveNeeded();
|
||||
app.updatePalette();
|
||||
|
|
|
@ -612,8 +612,12 @@ public class ScratchRuntime {
|
|||
private function updateVarRefs(oldName:String, newName:String, owner:ScratchObj):void {
|
||||
// Change the variable name in all blocks that use it.
|
||||
for each (var b:Block in allUsesOfVariable(oldName, owner)) {
|
||||
if (b.op == Specs.GET_VAR) b.setSpec(newName);
|
||||
else b.args[0].setArgValue(newName);
|
||||
if (b.op == Specs.GET_VAR) {
|
||||
b.setSpec(newName);
|
||||
b.fixExpressionLayout();
|
||||
} else {
|
||||
b.args[0].setArgValue(newName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue