This commit is contained in:
parent
dd2079b975
commit
3c164581ce
7 changed files with 34 additions and 34 deletions
|
@ -43,12 +43,12 @@ export function getDepth(parent: IContainerModel): number {
|
|||
* @returns The absolute position of the container
|
||||
*/
|
||||
export function getAbsolutePosition(container: IContainerModel): [number, number] {
|
||||
let x = Number(container.properties.x);
|
||||
let y = Number(container.properties.y);
|
||||
let x = container.properties.x;
|
||||
let y = container.properties.y;
|
||||
let current = container.parent;
|
||||
while (current != null) {
|
||||
x += Number(current.properties.x);
|
||||
y += Number(current.properties.y);
|
||||
x += current.properties.x;
|
||||
y += current.properties.y;
|
||||
current = current.parent;
|
||||
}
|
||||
return [x, y];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue