From 987592dc852486816fee357bb5c28dd22b6d2f18 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 31 Oct 2024 10:38:24 +0000 Subject: [PATCH] Ignore scale factor when refreshing the step placeholder dimensions --- .../AutomationBuilder/FlowChart/FlowItem.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index d88ab0d28c..39e92e2fc2 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -48,7 +48,8 @@ let blockDims const updateBlockDims = () => { - blockDims = blockEle?.getBoundingClientRect() + const { width, height } = blockEle?.getBoundingClientRect() + blockDims = { width: width / $view.scale, height: height / $view.scale } } const loadSteps = blockRef => { @@ -81,11 +82,11 @@ $: selected = $view?.moveStep && $view?.moveStep?.id === block.id - $: { - selected, updateBlockDims() + $: if (selected && blockEle) { + updateBlockDims() } - $: placeholderDims = buildPlaceholderStyles(blockDims, selected) + $: placeholderDims = buildPlaceholderStyles(blockDims) // Move the selected item // Listen for scrolling in the content. As its scrolled this will be updated