Normalize dimensions (#527)

* normalize dimensions of non-linear elements

* fix element type check regression
This commit is contained in:
David Luzar 2020-01-24 20:45:52 +01:00 committed by GitHub
parent d65e90209c
commit afb1d6725f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 141 additions and 39 deletions

View file

@ -86,3 +86,7 @@ export function removeSelection() {
selection.removeAllRanges();
}
}
export function distance(x: number, y: number) {
return Math.abs(x > y ? x - y : y - x);
}