diff --git a/blocks/procedures.js b/blocks/procedures.js index 130b4cf16..eebbb4ef0 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -756,9 +756,6 @@ const PROCEDURE_CALL_COMMON = { this.quarkConnections_ = {}; this.quarkIds_ = []; } - // Switch off rendering while the block is rebuilt. - const savedRendered = this.rendered; - this.rendered = false; // Update the quarkConnections_ with existing connections. for (let i = 0; i < this.arguments_.length; i++) { const input = this.getInput('ARG' + i); @@ -798,11 +795,6 @@ const PROCEDURE_CALL_COMMON = { } } } - // Restore rendering and show the changes. - this.rendered = savedRendered; - if (this.rendered) { - this.render(); - } }, /** * Modify this block to have the correct number of arguments. diff --git a/core/block_svg.ts b/core/block_svg.ts index c9db3554a..290358196 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -1000,6 +1000,8 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg, this.comment = null; // For backwards compatibility. } if (this.rendered) { + // Icons must force an immediate render so that bubbles can be opened + // immedately at the correct position. this.render(); // Adding or removing a comment icon will cause the block to change shape. this.bumpNeighbours(); @@ -1078,6 +1080,8 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg, } } if (changedState && this.rendered) { + // Icons must force an immediate render so that bubbles can be opened + // immedately at the correct position. this.render(); // Adding or removing a warning icon will cause the block to change shape. this.bumpNeighbours(); @@ -1099,6 +1103,8 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg, mutator.createIcon(); } if (this.rendered) { + // Icons must force an immediate render so that bubbles can be opened + // immedately at the correct position. this.render(); // Adding or removing a mutator icon will cause the block to change shape. this.bumpNeighbours(); diff --git a/core/flyout_horizontal.ts b/core/flyout_horizontal.ts index ef11978bb..91602a79a 100644 --- a/core/flyout_horizontal.ts +++ b/core/flyout_horizontal.ts @@ -244,7 +244,6 @@ export class HorizontalFlyout extends Flyout { // a block. child.isInFlyout = true; } - block!.render(); const root = block!.getSvgRoot(); const blockHW = block!.getHeightWidth(); // Figure out where to place the block. diff --git a/core/flyout_vertical.ts b/core/flyout_vertical.ts index d9a955ee6..3fab3e6dd 100644 --- a/core/flyout_vertical.ts +++ b/core/flyout_vertical.ts @@ -225,7 +225,6 @@ export class VerticalFlyout extends Flyout { // a block. child.isInFlyout = true; } - block!.render(); const root = block!.getSvgRoot(); const blockHW = block!.getHeightWidth(); const moveX = diff --git a/core/mutator.ts b/core/mutator.ts index ec7c817b1..f659c9f44 100644 --- a/core/mutator.ts +++ b/core/mutator.ts @@ -335,7 +335,7 @@ export class Mutator extends Icon { this.rootBlock = block.decompose!(ws)!; const blocks = this.rootBlock.getDescendants(false); for (let i = 0, child; child = blocks[i]; i++) { - child.render(); + child.queueRender(); } // The root block should not be draggable or deletable. this.rootBlock.setMovable(false); diff --git a/core/rendered_connection.ts b/core/rendered_connection.ts index 7ac0e8562..3e4e00b8e 100644 --- a/core/rendered_connection.ts +++ b/core/rendered_connection.ts @@ -514,12 +514,7 @@ export class RenderedConnection extends Connection { return; } blockShadow.initSvg(); - blockShadow.render(false); - - const parentBlock = this.getSourceBlock(); - if (parentBlock.rendered) { - parentBlock.queueRender(); - } + blockShadow.queueRender(); } /** diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index b2d05437b..539971a0c 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -1301,7 +1301,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { const blocks = this.getAllBlocks(false); // Render each block. for (let i = blocks.length - 1; i >= 0; i--) { - blocks[i].render(false); + blocks[i].queueRender(); } if (this.currentGesture_) {