This module exports a function registerMouseEventHandlers that sets up all mouse events. It interacts directly with the fractalRenderer instance.
- Copyright:
- Synaptory Fractal Traveler, 2025-2026
- License:
- MIT
- Source:
Members
(static, constant) MAX_PAN_DISTANCE
Maximum distance from origin to prevent panning out of view
- Source:
(inner, constant) DOUBLE_CLICK_THRESHOLD
How long should we wait before distinguish between double click and two single clicks.
- Source:
(inner, constant) DRAG_THRESHOLD
Tolerance of mouse movement before drag starts.
- Source:
(inner, constant) LONG_PRESS_THRESHOLD
Long press zoom configuration
- Source:
(inner) mouseHandlersRegistered
Global variable to track registration
- Source:
Methods
(static) clampPanDelta(currentPan, deltaPan) → {Array.<number>}
Clamps pan delta to ensure resulting pan stays within bounds
Parameters:
| Name | Type | Description |
|---|---|---|
currentPan |
Array.<number> | Current pan [x, y] |
deltaPan |
Array.<number> | Proposed delta [dx, dy] |
- Source:
Returns:
- Clamped delta [dx, dy]
- Type
- Array.<number>
(static) initMouseHandlers(app)
Initialization and registering of the event handlers.
Parameters:
| Name | Type | Description |
|---|---|---|
app |
FractalRenderer |
- Source:
(static) registerMouseEventHandlers()
Registers mouse handlers.
- Source:
(static) unregisterMouseEventHandlers()
Unregisters mouse handlers.
- Source:
(inner) flushWheelZoom()
Apply accumulated wheel delta once per RAF.
This reduces "bursty wheel" micro-jitter and keeps anchor math consistent.
- Source:
(inner) markOrbitDirtySafe()
Mark orbit dirty if the current renderer supports perturbation caching.
IMPORTANT: must NOT trigger orbit rebuild immediately (renderers should defer).
- Source:
(inner) startLongPressZoomIn()
Start the continuous long press zoom-in loop (left button).
Zooms in toward the anchor point while allowing panning.
- Source:
(inner) startLongPressZoomOut()
Start the continuous long press zoom-out loop (right button).
Zooms out from the anchor point while allowing panning.
- Source:
(inner) stopLongPressZoomIn()
Stop the long press zoom-in loop (left button).
- Source:
(inner) stopLongPressZoomOut()
Stop the long press zoom-out loop (right button).
- Source: