Remove Number() calls
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Siklos 2022-08-15 22:57:08 +02:00
parent dd2079b975
commit 3c164581ce
7 changed files with 34 additions and 34 deletions

View file

@ -42,8 +42,8 @@ function constraintBodyInsideParent(
}
const parentProperties = container.parent.properties;
const parentWidth = Number(parentProperties.width);
const parentHeight = Number(parentProperties.height);
const parentWidth = parentProperties.width;
const parentHeight = parentProperties.height;
return constraintBodyInsideSpace(container, 0, 0, parentWidth, parentHeight);
}
@ -66,10 +66,10 @@ function constraintBodyInsideSpace(
height: number
): IContainerModel {
const containerProperties = container.properties;
const containerX = Number(containerProperties.x);
const containerY = Number(containerProperties.y);
const containerWidth = Number(containerProperties.width);
const containerHeight = Number(containerProperties.height);
const containerX = containerProperties.x;
const containerY = containerProperties.y;
const containerWidth = containerProperties.width;
const containerHeight = containerProperties.height;
// Check size bigger than parent
const isBodyLargerThanParent = containerWidth > width;
@ -121,8 +121,8 @@ export function constraintBodyInsideUnallocatedWidth(
// Get the available spaces of the parent
const availableWidths = getAvailableWidths(container.parent, container);
const containerX = Number(container.properties.x);
const containerWidth = Number(container.properties.width);
const containerX = container.properties.x;
const containerWidth = container.properties.width;
// Check if there is still some space
if (availableWidths.length === 0) {
@ -177,7 +177,7 @@ export function constraintBodyInsideUnallocatedWidth(
availableWidthFound.x,
0,
availableWidthFound.width,
Number(container.parent.properties.height)
container.parent.properties.height
);
}
@ -197,7 +197,7 @@ function getAvailableWidths(
// Initialize the first size pointer
// which takes full width of the available space
const x = 0;
const width = Number(container.properties.width);
const width = container.properties.width;
let unallocatedSpaces: ISizePointer[] = [{ x, width }];
// We will only uses containers that also are rigid or are anchors
@ -211,7 +211,7 @@ function getAvailableWidths(
continue;
}
const childX = child.properties.x;
const childWidth = Number(child.properties.width);
const childWidth = child.properties.width;
// get the space of the child that is inside the parent
let newUnallocatedSpace: ISizePointer[] = [];
@ -309,4 +309,4 @@ function getAvailableWidthsTwoLines(
const isFitting = (
container: IContainerModel,
sizePointer: ISizePointer
): boolean => Number(container.properties.width) <= sizePointer.width;
): boolean => container.properties.width <= sizePointer.width;