Implement Insert in SetContainerList
This commit is contained in:
parent
0d761e6a41
commit
e63b2779e1
3 changed files with 94 additions and 35 deletions
|
@ -12,7 +12,7 @@ import { ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
|||
import { Orientation } from '../../../Enums/Orientation';
|
||||
import { GetDefaultContainerProps } from '../../../utils/default';
|
||||
import { FindContainerById } from '../../../utils/itertools';
|
||||
import { ApplyMargin } from '../../../utils/svg';
|
||||
import { ApplyMargin, RestoreX, RestoreY, TransformX } from '../../../utils/svg';
|
||||
import { ApplyBehaviors, ApplyBehaviorsOnSiblingsChildren } from '../Behaviors/Behaviors';
|
||||
import { GetCurrentHistory, UpdateCounters } from '../Editor';
|
||||
import { SortChildren } from './ContainerOperations';
|
||||
|
@ -130,10 +130,10 @@ function AddNewContainerToParent(
|
|||
const right: number = containerConfig.Margin?.right ?? 0;
|
||||
|
||||
// Default coordinates
|
||||
let x = containerConfig.X ?? 0;
|
||||
let y = containerConfig.Y ?? 0;
|
||||
let width = containerConfig.Width ?? containerConfig.MaxWidth ?? containerConfig.MinWidth ?? parentClone.properties.width;
|
||||
let height = containerConfig.Height ?? containerConfig.MaxHeight ?? containerConfig.MinHeight ?? parentClone.properties.height;
|
||||
let x = RestoreX(containerConfig.X ?? 0, width, containerConfig.PositionReference);
|
||||
let y = RestoreY(containerConfig.Y ?? 0, height, containerConfig.PositionReference);
|
||||
|
||||
({ x, y, width, height } = ApplyMargin(x, y, width, height, left, bottom, top, right));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue