Skip to content

Commit c53f197

Browse files
committed
npm run format
1 parent 50feb27 commit c53f197

File tree

129 files changed

+10672
-7327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+10672
-7327
lines changed

src/lib/litegraph/src/CanvasPointer.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import type { CompassCorners } from "./interfaces"
2-
import type { CanvasPointerEvent } from "./types/events"
3-
4-
import { dist2 } from "./measure"
1+
import type { CompassCorners } from './interfaces'
2+
import { dist2 } from './measure'
3+
import type { CanvasPointerEvent } from './types/events'
54

65
/**
76
* Allows click and drag actions to be declared ahead of time during a pointerdown event.
@@ -174,7 +173,8 @@ export class CanvasPointer {
174173
// Dragging, but no callback to run
175174
if (this.dragStarted) return
176175

177-
const longerThanBufferTime = e.timeStamp - eDown.timeStamp > CanvasPointer.bufferTime
176+
const longerThanBufferTime =
177+
e.timeStamp - eDown.timeStamp > CanvasPointer.bufferTime
178178
if (longerThanBufferTime || !this.#hasSamePosition(e, eDown)) {
179179
this.#setDragStarted(e)
180180
}
@@ -227,7 +227,7 @@ export class CanvasPointer {
227227
#hasSamePosition(
228228
a: PointerEvent,
229229
b: PointerEvent,
230-
tolerance2 = CanvasPointer.#maxClickDrift2,
230+
tolerance2 = CanvasPointer.#maxClickDrift2
231231
): boolean {
232232
const drift = dist2(a.clientX, a.clientY, b.clientX, b.clientY)
233233
return drift <= tolerance2
@@ -244,9 +244,11 @@ export class CanvasPointer {
244244
// Use thrice the drift distance for double-click gap
245245
const tolerance2 = (3 * CanvasPointer.#maxClickDrift) ** 2
246246
const diff = eDown.timeStamp - eLastDown.timeStamp
247-
return diff > 0 &&
247+
return (
248+
diff > 0 &&
248249
diff < CanvasPointer.doubleClickTime &&
249250
this.#hasSamePosition(eDown, eLastDown, tolerance2)
251+
)
250252
}
251253

252254
#setDragStarted(eMove?: CanvasPointerEvent): void {
@@ -283,7 +285,7 @@ export class CanvasPointer {
283285

284286
const { element, pointerId } = this
285287
this.pointerId = undefined
286-
if (typeof pointerId === "number" && element.hasPointerCapture(pointerId)) {
288+
if (typeof pointerId === 'number' && element.hasPointerCapture(pointerId)) {
287289
element.releasePointerCapture(pointerId)
288290
}
289291
}

0 commit comments

Comments
 (0)