Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions core/workspace_svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2581,24 +2581,24 @@ export class WorkspaceSvg
rawViewport.left + rawViewport.width,
);

// Add the padding to the bounds so the element is scrolled comfortably
// into view.
bounds = bounds.clone();
bounds.top -= padding;
bounds.bottom += padding;
bounds.left -= padding;
bounds.right += padding;

if (
bounds.left >= viewport.left &&
bounds.top >= viewport.top &&
bounds.right <= viewport.right &&
bounds.bottom <= viewport.bottom
) {
// Do nothing if the block is fully inside the viewport.
// Do nothing if the block with padding is fully inside the viewport.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit while this comment is being edited: should be "bounds", not "block"

return;
}

// Add some padding to the bounds so the element is scrolled comfortably
// into view.
bounds = bounds.clone();
bounds.top -= padding;
bounds.bottom += padding;
bounds.left -= padding;
bounds.right += padding;

let deltaX = 0;
let deltaY = 0;

Expand Down
Loading