Skip to content

Commit

Permalink
release: v9.3.3
Browse files Browse the repository at this point in the history
Merge pull request #7016 from google/rc/v9.3.3
  • Loading branch information
BeksOmega authored Apr 26, 2023
2 parents ec6e951 + e86183e commit 399bd65
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/insertion_marker_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,18 @@ export class InsertionMarkerManager {
*/
applyConnections() {
if (!this.activeCandidate) return;
const {local, closest} = this.activeCandidate;
local.connect(closest);
eventUtils.disable();
this.hidePreview();
eventUtils.enable();
const {local, closest} = this.activeCandidate;
local.connect(closest);
if (this.topBlock.rendered) {
const inferiorConnection = local.isSuperior() ? closest : local;
blockAnimations.connectionUiEffect(inferiorConnection.getSourceBlock());
const rootBlock = this.topBlock.getRootBlock();

// bringToFront is incredibly expensive. Delay by at least a frame.
requestAnimationFrame(() => {
blockAnimations.connectionUiEffect(inferiorConnection.getSourceBlock());
setTimeout(() => {
rootBlock.bringToFront();
}, 0);
Expand Down
17 changes: 17 additions & 0 deletions core/render_management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function doRenders() {

renderBlock(block);
updateConnectionLocations(block, block.getRelativeToSurfaceXY());
updateIconLocations(block);
}
for (const workspace of workspaces) {
workspace.resizeContents();
Expand Down Expand Up @@ -98,3 +99,19 @@ function updateConnectionLocations(block: BlockSvg, blockOrigin: Coordinate) {
}
}
}

/**
* Updates all icons that are children of the given block with their new
* locations.
*
* @param block The block to update the icon locations of.
*/
function updateIconLocations(block: BlockSvg) {
if (!block.getIcons) return;
for (const icon of block.getIcons()) {
icon.computeIconLocation();
}
for (const child of block.getChildren(false)) {
updateIconLocations(child);
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockly",
"version": "9.3.2",
"version": "9.3.3",
"description": "Blockly is a library for building visual programming editors.",
"keywords": [
"blockly"
Expand Down

0 comments on commit 399bd65

Please sign in to comment.