Default action of AddContainer will now be append
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
35bb95f206
commit
cf1a3a7eec
1 changed files with 7 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue