mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added check on map zooming to disable box select
This commit is contained in:
parent
1dceb0b421
commit
98862d917c
@ -72,7 +72,7 @@ export class Map extends L.Map {
|
||||
|
||||
#temporaryMarkers: TemporaryUnitMarker[] = [];
|
||||
|
||||
#selecting: boolean = false;
|
||||
#isSelecting: boolean = false;
|
||||
#isZooming: boolean = false;
|
||||
#previousZoom: number = 0;
|
||||
|
||||
@ -96,7 +96,7 @@ export class Map extends L.Map {
|
||||
#waitingForDoubleClick: boolean = false;
|
||||
#doubleClickTimer: number = 0;
|
||||
#longPressTimer: number = 0;
|
||||
#dragging: boolean = false;
|
||||
#isDragging: boolean = false;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -801,19 +801,19 @@ export class Map extends L.Map {
|
||||
#onContextMenu(e: any) {}
|
||||
|
||||
#onDragStart(e: any) {
|
||||
this.#dragging = true;
|
||||
this.#isDragging = true;
|
||||
}
|
||||
|
||||
#onDragEnd(e: any) {
|
||||
this.#dragging = false;
|
||||
this.#isDragging = false;
|
||||
}
|
||||
|
||||
#onSelectionStart(e: any) {
|
||||
this.#selecting = true;
|
||||
this.#isSelecting = true;
|
||||
}
|
||||
|
||||
#onSelectionEnd(e: any) {
|
||||
this.#selecting = false;
|
||||
this.#isSelecting = false;
|
||||
clearTimeout(this.#leftClickTimer);
|
||||
this.#preventLeftClick = true;
|
||||
this.#leftClickTimer = window.setTimeout(() => {
|
||||
@ -829,7 +829,7 @@ export class Map extends L.Map {
|
||||
|
||||
#onMouseDown(e: any) {
|
||||
this.#longPressTimer = window.setTimeout(()=> {
|
||||
if (!this.#dragging)
|
||||
if (!this.#isDragging && !this.#isZooming)
|
||||
if (e.type === "touchstart")
|
||||
document.dispatchEvent(new CustomEvent("mapForceBoxSelect", {detail: e}));
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user