Fix potential bug with non valid margin values

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

View file

@ -113,6 +113,8 @@ export function RemoveMargin(
top?: number, top?: number,
right?: number right?: number
): { x: number, y: number, width: number, height: number } { ): { x: number, y: number, width: number, height: number } {
left = left ?? 0;
right = right ?? 0;
bottom = bottom ?? 0; bottom = bottom ?? 0;
top = top ?? 0; top = top ?? 0;
x = RemoveXMargin(x, left); x = RemoveXMargin(x, left);