Minor optimizations

This commit is contained in:
Pax1601
2023-05-29 17:09:06 +02:00
parent 45bb49cfe1
commit 4087dbde21
6 changed files with 38 additions and 25 deletions

View File

@@ -111,8 +111,9 @@ export class Map extends L.Map {
/* Pan interval */
this.#panInterval = window.setInterval(() => {
this.panBy(new L.Point(((this.#panLeft ? -1 : 0) + (this.#panRight ? 1 : 0)) * this.#deafultPanDelta,
((this.#panUp ? -1 : 0) + (this.#panDown ? 1 : 0)) * this.#deafultPanDelta));
if (this.#panLeft || this.#panDown || this.#panRight || this.#panLeft)
this.panBy(new L.Point(((this.#panLeft? -1 : 0) + (this.#panRight ? 1 : 0)) * this.#deafultPanDelta,
((this.#panUp ? -1 : 0) + (this.#panDown ? 1 : 0)) * this.#deafultPanDelta));
}, 20);
/* Option buttons */