Fix setting margins causing invalid values

This commit is contained in:
Eric NGUYEN 2022-10-18 15:21:41 +02:00
parent d778e85b99
commit 7790ff6dfa

View file

@ -327,7 +327,7 @@ function AssignProperty(container: ContainerModel, key: string, value: string |
function SetMargin(): void {
// We need to detect change in order to apply transformation to the width and height
// Knowing the current margin is not enough as we dont keep the original width and height
const oldMarginValue: number = (container.properties.margin as any)[key];
const oldMarginValue: number = (container.properties.margin as any)[key] ?? 0;
const diff = Number(value) - oldMarginValue;
switch (key) {
case 'left':