Skip to content

Commit

Permalink
fix: Take the flyout into account when positioning the workspace afte…
Browse files Browse the repository at this point in the history
…r a toolbox change. (#8617)

* fix: Take the flyout into account when positioning the workspace after a toolbox change.

* fix: Accomodate top-positioned toolboxes.
  • Loading branch information
gonfunko authored Oct 14, 2024
1 parent 9fc6931 commit edd02f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/toolbox/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,18 @@ export class Toolbox
// relative to the new absolute edge (ie toolbox edge).
const workspace = this.workspace_;
const rect = this.HtmlDiv!.getBoundingClientRect();
const flyout = this.getFlyout();
const newX =
this.toolboxPosition === toolbox.Position.LEFT
? workspace.scrollX + rect.width
? workspace.scrollX +
rect.width +
(flyout?.isVisible() ? flyout.getWidth() : 0)
: workspace.scrollX;
const newY =
this.toolboxPosition === toolbox.Position.TOP
? workspace.scrollY + rect.height
? workspace.scrollY +
rect.height +
(flyout?.isVisible() ? flyout.getHeight() : 0)
: workspace.scrollY;
workspace.translate(newX, newY);

Expand Down

0 comments on commit edd02f6

Please sign in to comment.