From 22c0856880ec3ea5c64e2b172dadd2c5bed8d1b2 Mon Sep 17 00:00:00 2001 From: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com> Date: Fri, 11 Apr 2025 16:08:18 -0700 Subject: [PATCH] [release-11.5.4] Canvas: Fix layout calcs for scale mode (#103945) Canvas: Fix layout calcs for scale mode (#103408) (cherry picked from commit 5efb620f1bb71231c296519bfbcc3ccadcaddfc8) --- public/app/features/canvas/runtime/element.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/app/features/canvas/runtime/element.tsx b/public/app/features/canvas/runtime/element.tsx index 5297eb2b470..5c2c78d9c2d 100644 --- a/public/app/features/canvas/runtime/element.tsx +++ b/public/app/features/canvas/runtime/element.tsx @@ -320,8 +320,8 @@ export class ElementState implements LayerElement { placement.height = height; break; case VerticalConstraint.Scale: - placement.top = (relativeTop / (parentContainer?.height ?? height)) * 100; - placement.bottom = (relativeBottom / (parentContainer?.height ?? height)) * 100; + placement.top = (relativeTop / (parentContainer?.height ?? height)) * 100 * transformScale; + placement.bottom = (relativeBottom / (parentContainer?.height ?? height)) * 100 * transformScale; break; } @@ -346,8 +346,8 @@ export class ElementState implements LayerElement { placement.width = width; break; case HorizontalConstraint.Scale: - placement.left = (relativeLeft / (parentContainer?.width ?? width)) * 100; - placement.right = (relativeRight / (parentContainer?.width ?? width)) * 100; + placement.left = (relativeLeft / (parentContainer?.width ?? width)) * 100 * transformScale; + placement.right = (relativeRight / (parentContainer?.width ?? width)) * 100 * transformScale; break; }