Fix multiple bugs #10

Merged
Siklos merged 7 commits from dev.rigidbody into master 2022-08-05 07:30:34 -04:00
Showing only changes of commit cf1a3a7eec - Show all commits

View file

@ -212,13 +212,19 @@ class Editor extends React.Component<IEditorProps> {
throw new Error('[OnPropertyChange] Container model was not found among children of the main container!');
}
let x = 0;
const lastChild: IContainerModel | undefined = parent.children.at(-1);
if (lastChild !== undefined) {
x = lastChild.properties.x + Number(lastChild.properties.width);
}
// Create the container
const newContainer = new ContainerModel(
parent,
{
id: `${type}-${count}`,
parentId: parent.properties.id,
x: 0,
x,
y: 0,
width: properties?.Width,
height: parent.properties.height,