Implement borrower dimension

This commit is contained in:
Eric NGUYEN 2022-08-30 17:36:48 +02:00
parent 57e6c9a156
commit 5fa9db931f
7 changed files with 117 additions and 14 deletions

View file

@ -83,9 +83,14 @@ export function GetAbsolutePosition(container: IContainerModel): [number, number
* @param y value to be restored
* @returns x and y such that the transformations of the parent are cancelled
*/
export function CancelParentTransform(parent: IContainerModel | null, x: number, y: number): [number, number] {
export function CancelParentTransform(
parent: IContainerModel | null,
x: number,
y: number,
stop?: IContainerModel
): [number, number] {
let current = parent;
while (current != null) {
while (current !== stop && current != null) {
x += current.properties.x;
y += current.properties.y;
current = current.parent;