From edd02f6955d9d391a04be3ac6acc93f0344078ad Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 14 Oct 2024 08:19:49 -0700 Subject: [PATCH] fix: Take the flyout into account when positioning the workspace after a toolbox change. (#8617) * fix: Take the flyout into account when positioning the workspace after a toolbox change. * fix: Accomodate top-positioned toolboxes. --- core/toolbox/toolbox.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/toolbox/toolbox.ts b/core/toolbox/toolbox.ts index cd91b2d8a..0c5a8e2a4 100644 --- a/core/toolbox/toolbox.ts +++ b/core/toolbox/toolbox.ts @@ -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);