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