Implement borrower dimension
This commit is contained in:
parent
57e6c9a156
commit
5fa9db931f
7 changed files with 117 additions and 14 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue