Fix bugs created by using Number()
This commit is contained in:
parent
3c164581ce
commit
dcfb93aa12
4 changed files with 11 additions and 7 deletions
|
@ -20,8 +20,8 @@ export function NewEditor(
|
|||
parentId: 'null',
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: configuration.MainContainer.Width,
|
||||
height: configuration.MainContainer.Height,
|
||||
width: Number(configuration.MainContainer.Width),
|
||||
height: Number(configuration.MainContainer.Height),
|
||||
isRigidBody: false,
|
||||
isAnchor: false,
|
||||
fillOpacity: 0,
|
||||
|
|
|
@ -209,6 +209,7 @@ export function AddContainer(
|
|||
x = ApplyAddMethod(index, containerConfig, parentClone, x);
|
||||
|
||||
const defaultProperties: IProperties = {
|
||||
...containerConfig.Style,
|
||||
id: `${type}-${count}`,
|
||||
parentId: parentClone.properties.id,
|
||||
x,
|
||||
|
@ -217,9 +218,9 @@ export function AddContainer(
|
|||
height,
|
||||
isRigidBody: false,
|
||||
isAnchor: false,
|
||||
XPositionReference: containerConfig.XPositionReference,
|
||||
...containerConfig.Style
|
||||
XPositionReference: containerConfig.XPositionReference
|
||||
};
|
||||
|
||||
// Create the container
|
||||
const newContainer = new ContainerModel(
|
||||
parentClone,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import * as React from 'react';
|
||||
import { expect, describe, it, vi } from 'vitest';
|
||||
import IProperties from '../../Interfaces/IProperties';
|
||||
import { Properties } from './Properties';
|
||||
|
||||
describe.concurrent('Properties', () => {
|
||||
|
@ -18,11 +19,13 @@ describe.concurrent('Properties', () => {
|
|||
});
|
||||
|
||||
it('Some properties, change values with dynamic input', () => {
|
||||
const prop = {
|
||||
const prop: IProperties = {
|
||||
id: 'stuff',
|
||||
parentId: 'parentId',
|
||||
x: 1,
|
||||
y: 1,
|
||||
width: 1,
|
||||
height: 1,
|
||||
isRigidBody: false,
|
||||
isAnchor: false
|
||||
};
|
||||
|
|
|
@ -30,8 +30,8 @@ export const DEFAULT_MAINCONTAINER_PROPS: IProperties = {
|
|||
parentId: 'null',
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: DEFAULT_CONFIG.MainContainer.Width,
|
||||
height: DEFAULT_CONFIG.MainContainer.Height,
|
||||
width: Number(DEFAULT_CONFIG.MainContainer.Width),
|
||||
height: Number(DEFAULT_CONFIG.MainContainer.Height),
|
||||
isRigidBody: false,
|
||||
isAnchor: false,
|
||||
fillOpacity: 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue