fix some element types reset to selection when the lock is active (#746)

* keep arrows and lines selected if locked

* keep element type selected if locked after inserting text

* ensure clicking outside doesn't create new text

* esc should switch to selection even if locked

* reset cursor when creating text via doubleClick

Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
lissitz 2020-02-10 15:09:50 +01:00 committed by GitHub
parent 1ec3946ed6
commit fa12125db0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 15 deletions

View file

@ -126,3 +126,7 @@ export function distance2d(x1: number, y1: number, x2: number, y2: number) {
const yd = y2 - y1;
return Math.sqrt(xd * xd + yd * yd);
}
export function resetCursor() {
document.documentElement.style.cursor = "";
}