Canvas: Fix resize breaking certain constraints (#49551)

This commit is contained in:
Nathan Marrs 2022-05-24 20:19:08 -07:00 committed by GitHub
parent 9fdbc60ce9
commit bb4a834ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}