|
| void | onMouseDown (EditorApp &editor, const Vector2d &documentPoint, MouseModifiers modifiers) override |
| | Mouse button (left) was pressed at documentPoint. modifiers captures the modifier-key state at the moment of the press; implementations that don't care can ignore it. Default arguments on virtuals are banned by the style guide, so callers that don't need modifier state should pass MouseModifiers{} explicitly.
|
| void | onMouseMove (EditorApp &editor, const Vector2d &documentPoint, bool buttonHeld) override |
| | Mouse moved to documentPoint. buttonHeld is true while the left button is down - i.e., this is a drag continuation rather than a hover.
|
|
void | onMouseMove (EditorApp &editor, const Vector2d &documentPoint, bool buttonHeld, MouseModifiers modifiers) |
| | Mouse-move variant that samples live modifiers during resize gestures.
|
| void | onMouseUp (EditorApp &editor, const Vector2d &documentPoint) override |
| | Mouse button was released at documentPoint.
|
| bool | tryStartRedragOnSelected (EditorApp &editor, const Vector2d &documentPoint, MouseModifiers modifiers, std::span< const Box2d > selectionBoundsDoc, std::span< const Box2d > occludingBoundsDoc={}) |
| | Snapshot-safe re-drag start (design doc 0033 §M8). When the user clicks inside the bounds of the single currently-selected element, start a drag of that element WITHOUT calling EditorApp::hitTest.
|
| bool | clickHitsCurrentSelection (EditorApp &editor, const Vector2d &documentPoint) const |
| | Returns true when live hit-testing at documentPoint hits the current selectable selection or one of its renderable descendants.
|
| bool | clickHitsImmediatelySelectableElement (EditorApp &editor, const Vector2d &documentPoint) const |
| | Returns true when live hit-testing at documentPoint hits an element that can be selected immediately by a canvas press.
|
|
bool | isDragging () const |
| | Whether a drag is currently in progress (button is held after a successful hit-test on mouse-down).
|
|
bool | isMarqueeing () const |
| | Whether a marquee selection is currently in progress (button is held after a onMouseDown that hit empty space).
|
|
void | beginMarquee (EditorApp &editor, const Vector2d &documentPoint, bool additive) |
| | Start a marquee drag from documentPoint without performing a hit-test.
|
|
std::optional< Box2d > | marqueeRect () const |
| | The current marquee rectangle in document coordinates, or std::nullopt if no marquee drag is active. Returned even on the very first frame of a marquee (rect collapses to a single point). Used by the overlay renderer to draw the marquee chrome.
|
|
std::optional< CompletedDragWriteback > | consumeCompletedDragWriteback () |
| | Returns the most recent completed drag writeback request, if any. The payload is latched until consumed so the main loop can retry writeback across busy frames without depending on the current selection.
|
|
std::optional< ActiveDragPreview > | activeDragPreview () const |
| | Returns the current drag preview, if a drag is in progress.
|
|
std::optional< ActiveGesturePreview > | activeGesturePreview () const |
| | Returns the current selection gesture preview, if a drag is in progress.
|
|
std::optional< ActiveTransformBoundsPreview > | activeTransformBoundsPreview () const |
| | Returns bounds chrome derived from the gesture's immutable start bounds and current transform. Available for every moved drag so the overlay does not need to walk live geometry while the render worker is active.
|
|
std::optional< LockedRejectionFlash > | lockedRejectionFlash () const |
| | The active locked-selection rejection flash, or std::nullopt. The overlay renderer draws this as a red outline on the rejected (locked) element.
|
|
void | tickLockedRejectionFlash (float deltaSeconds) |
| | Advance the locked-rejection flash fade by deltaSeconds, clearing it once fully faded. Called once per frame by the editor shell.
|
|
| Tool (const Tool &)=delete |
|
Tool & | operator= (const Tool &)=delete |
|
| Tool (Tool &&)=delete |
|
Tool & | operator= (Tool &&)=delete |
| bool donner::editor::SelectTool::tryStartRedragOnSelected |
( |
EditorApp & | editor, |
|
|
const Vector2d & | documentPoint, |
|
|
MouseModifiers | modifiers, |
|
|
std::span< const Box2d > | selectionBoundsDoc, |
|
|
std::span< const Box2d > | occludingBoundsDoc = {} ) |
|
nodiscard |
Snapshot-safe re-drag start (design doc 0033 §M8). When the user clicks inside the bounds of the single currently-selected element, start a drag of that element WITHOUT calling EditorApp::hitTest.
- so the call is safe to run even while the async-renderer worker is mid-render (hitTest would race the worker's prepareDocumentForRendering).
selectionBoundsDoc and occludingBoundsDoc are caller-supplied AABB lists in document space. EditorShell passes the pre-snapshotted bounds from SelectionBoundsCache - that cache is refreshed on idle frames, so reading it during a busy render is race-free (no live SnapshotSelectionWorldBounds call inside this function). onMouseDown passes freshly-computed live selection bounds and no occlusion hints since its caller has already gated on !isBusy().
Returns true if a drag was started; false if the caller must fall back to the full onMouseDown path (multi-select, shift-click, click outside the selection's snapshotted bounds, click inside later-painted cached bounds, empty bounds span, etc.).
onMouseDown itself calls this first to avoid duplicating logic
- so plain clicks on the selection always take the no-hit-test path regardless of busy state. The split exists so EditorShell can run it BEFORE checking isBusy() for the click handler.