Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::SelectTool Class Referencefinal
Inheritance diagram for donner::editor::SelectTool:
[legend]
Collaboration diagram for donner::editor::SelectTool:
[legend]

Classes

struct  ActiveDragPreview
 Preview state for an in-progress drag, consumed by the async renderer. More...
struct  CompletedDragWriteback
 Payload needed to write a completed drag back into the source pane. For multi-element drags this is the primary; additional writeback entries are latched in extras. More...

Public Member Functions

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 onMouseUp (EditorApp &editor, const Vector2d &documentPoint) override
 Mouse button was released at documentPoint.
void setCompositedDragPreviewEnabled (bool enabled)
 Enable the experimental compositor-backed drag preview path.
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).
std::optional< Box2dmarqueeRect () 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< CompletedDragWritebackconsumeCompletedDragWriteback ()
 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< ActiveDragPreviewactiveDragPreview () const
 Returns the current drag preview, if a drag is in progress.
Public Member Functions inherited from donner::editor::Tool
 Tool (const Tool &)=delete
Tool & operator= (const Tool &)=delete
 Tool (Tool &&)=delete
Tool & operator= (Tool &&)=delete

Class Documentation

◆ donner::editor::SelectTool::ActiveDragPreview

struct donner::editor::SelectTool::ActiveDragPreview

Preview state for an in-progress drag, consumed by the async renderer.

Collaboration diagram for donner::editor::SelectTool::ActiveDragPreview:
[legend]
Class Members
Entity entity = entt::null
Vector2d translation = Vector2d::Zero()

◆ donner::editor::SelectTool::CompletedDragWriteback

struct donner::editor::SelectTool::CompletedDragWriteback

Payload needed to write a completed drag back into the source pane. For multi-element drags this is the primary; additional writeback entries are latched in extras.

Collaboration diagram for donner::editor::SelectTool::CompletedDragWriteback:
[legend]
Class Members
vector< CompletedDragWriteback > extras Additional writeback entries for extra elements in a multi-element drag. One per non-primary element that had a capturable writeback target. Empty for single-element drags.
AttributeWritebackTarget target
Transform2d transform

Member Function Documentation

◆ onMouseDown()

void donner::editor::SelectTool::onMouseDown ( EditorApp & editor,
const Vector2d & documentPoint,
MouseModifiers modifiers )
overridevirtual

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.

Implements donner::editor::Tool.

◆ onMouseMove()

void donner::editor::SelectTool::onMouseMove ( EditorApp & editor,
const Vector2d & documentPoint,
bool buttonHeld )
overridevirtual

Mouse moved to documentPoint. buttonHeld is true while the left button is down — i.e., this is a drag continuation rather than a hover.

Implements donner::editor::Tool.

◆ onMouseUp()

void donner::editor::SelectTool::onMouseUp ( EditorApp & editor,
const Vector2d & documentPoint )
overridevirtual

Mouse button was released at documentPoint.

Implements donner::editor::Tool.


The documentation for this class was generated from the following file: