mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
feat: add basic render queueing (#6851)
* feat: add basic render queueing * feat: change connecting and disconnecting to queue renders * feat: delay bringToFront * chore: format * chore: fix build * fix: stop updating connections when setting the parent. This was causing erroneous block bumps because the connection locations were changed before the blocks were actually rerendered. * fix: connection highlight positioning
This commit is contained in:
@@ -230,7 +230,7 @@ export class BlockDragger implements IBlockDragger {
|
||||
// These are expensive and don't need to be done if we're deleting.
|
||||
this.draggingBlock_.setDragging(false);
|
||||
if (delta) { // !preventMove
|
||||
this.updateBlockAfterMove_(delta);
|
||||
this.updateBlockAfterMove_();
|
||||
} else {
|
||||
// Blocks dragged directly from a flyout may need to be bumped into
|
||||
// bounds.
|
||||
@@ -283,18 +283,14 @@ export class BlockDragger implements IBlockDragger {
|
||||
|
||||
/**
|
||||
* Updates the necessary information to place a block at a certain location.
|
||||
*
|
||||
* @param delta The change in location from where the block started the drag
|
||||
* to where it ended the drag.
|
||||
*/
|
||||
protected updateBlockAfterMove_(delta: Coordinate) {
|
||||
this.draggingBlock_.moveConnections(delta.x, delta.y);
|
||||
protected updateBlockAfterMove_() {
|
||||
this.fireMoveEvent_();
|
||||
if (this.draggedConnectionManager_.wouldConnectBlock()) {
|
||||
// Applying connections also rerenders the relevant blocks.
|
||||
this.draggedConnectionManager_.applyConnections();
|
||||
} else {
|
||||
this.draggingBlock_.render();
|
||||
this.draggingBlock_.queueRender();
|
||||
}
|
||||
this.draggingBlock_.scheduleSnapAndBump();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user