mirror of
https://github.com/google/blockly.git
synced 2026-01-11 10:57:07 +01:00
Fix bug with in bounds bumping (#2467)
Traced one cause of Mocha tests sometimes failing to blocks being bumped back into bounds. It looks like a block being moved to be a child of another block was ended up out of bounds probably because the size of the workspace isn't set yet. When the change handler tried to move it back in it would throw an error since you can't move child blocks with that method.
This commit is contained in:
@@ -294,6 +294,7 @@ Blockly.createMainWorkspace_ = function(svg, options, blockDragSurface,
|
||||
case Blockly.Events.BLOCK_CREATE:
|
||||
case Blockly.Events.BLOCK_MOVE:
|
||||
var object = mainWorkspace.getBlockById(e.blockId);
|
||||
object = object.getRootBlock();
|
||||
break;
|
||||
case Blockly.Events.COMMENT_CREATE:
|
||||
case Blockly.Events.COMMENT_MOVE:
|
||||
|
||||
Reference in New Issue
Block a user