fix margin not making layout dirty

This commit is contained in:
Aran-Fey
2024-05-18 19:53:19 +02:00
parent 68e9193489
commit c7a0b3f6a1
2 changed files with 15 additions and 1 deletions
+6 -1
View File
@@ -24,7 +24,12 @@ export class AlignComponent extends ComponentBase {
): void {
this.replaceOnlyChild(latentComponents, deltaState.content);
this.makeLayoutDirty();
if (
deltaState.align_x !== undefined ||
deltaState.align_y !== undefined
) {
this.makeLayoutDirty();
}
}
updateNaturalWidth(ctx: LayoutContext): void {
+9
View File
@@ -25,6 +25,15 @@ export class MarginComponent extends ComponentBase {
latentComponents: Set<ComponentBase>
): void {
this.replaceOnlyChild(latentComponents, deltaState.content);
if (
deltaState.margin_left !== undefined ||
deltaState.margin_top !== undefined ||
deltaState.margin_right !== undefined ||
deltaState.margin_bottom !== undefined
) {
this.makeLayoutDirty();
}
}
updateNaturalWidth(ctx: LayoutContext): void {