blockly > BlockSvg > bumpNeighbours
BlockSvg.bumpNeighbours() method
Bumps unconnected blocks out of alignment.
Two blocks which aren't actually connected should not coincidentally line up on screen, because that creates confusion for end-users.
Signature:
bumpNeighbours(): void;
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `bumpNeighbours()` method prevents unconnected blocks from visually aligning, avoiding user confusion."],["This is achieved by slightly shifting the positions of unconnected blocks that happen to overlap or line up."],["The function does not return any value and is used to improve the visual clarity of the block arrangement."]]],["The `bumpNeighbours` method in BlockSvg repositions unconnected blocks to prevent them from aligning coincidentally on the screen. This action is performed to avoid user confusion caused by the misleading appearance of a connection. The method has no parameters and returns nothing (`void`). Its core function is to adjust the positioning of blocks that are not linked to ensure clear visual separation.\n"]]