Canvas: Fix resize breaking certain constraints (#49551) (#49553)

Co-authored-by: Nathan Marrs <nathanielmarrs@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-05-25 09:43:43 -07:00
committed by GitHub
co-authored by Nathan Marrs
parent 0cc75cc593
commit 8f8be23032
@@ -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;
}