Canvas: Fix resize breaking certain constraints (#49551)

pull/49560/head
Nathan Marrs 3 years ago committed by GitHub
parent 9fdbc60ce9
commit bb4a834ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      public/app/features/canvas/runtime/element.tsx

@ -114,6 +114,7 @@ export class ElementState implements LayerElement {
style.top = `${placement.top}px`;
style.bottom = `${placement.bottom}px`;
delete placement.height;
style.height = '';
break;
case VerticalConstraint.Center:
placement.top = placement.top ?? 0;
@ -129,6 +130,7 @@ export class ElementState implements LayerElement {
style.top = `${placement.top}%`;
style.bottom = `${placement.bottom}%`;
delete placement.height;
style.height = '';
break;
}
@ -153,6 +155,7 @@ export class ElementState implements LayerElement {
style.left = `${placement.left}px`;
style.right = `${placement.right}px`;
delete placement.width;
style.width = '';
break;
case HorizontalConstraint.Center:
placement.left = placement.left ?? 0;
@ -168,6 +171,7 @@ export class ElementState implements LayerElement {
style.left = `${placement.left}%`;
style.right = `${placement.right}%`;
delete placement.width;
style.width = '';
break;
}

Loading…
Cancel
Save