simplify distance helper and factor out common bounds helper (#581)

* simplify distance helper

* factor out common bounds helper
This commit is contained in:
David Luzar 2020-01-26 20:15:08 +01:00 committed by Christopher Chedeau
parent 5853fba821
commit 7b842fc330
7 changed files with 42 additions and 77 deletions

View file

@ -88,5 +88,5 @@ export function removeSelection() {
}
export function distance(x: number, y: number) {
return Math.abs(x > y ? x - y : y - x);
return Math.abs(x - y);
}