Edit

data class Edit(val entityId: EntityId, val activeDrag: DrawMode.Edit.ActiveDrag? = null, val selectedVertexId: VertexId? = null) : DrawMode

entityId's vertices are being edited (selected, dragged, or having points inserted).

activeDrag is non-null only between a DragStart and its matching DragEnd — see ActiveDrag for the two things a drag can mean.

Constructors

Link copied to clipboard
constructor(entityId: EntityId, activeDrag: DrawMode.Edit.ActiveDrag? = null, selectedVertexId: VertexId? = null)

Types

Link copied to clipboard
sealed interface ActiveDrag

What an in-progress drag inside Edit is doing. Modeled as two distinct cases (rather than a flatter handful of nullable fields) so "dragging an existing vertex" and "dragging a not-yet-real new vertex into existence" can't be represented at the same time or confused with each other.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The vertex last tapped or grabbed, which DrawEvent.DeleteSelectedVertex removes; null when none is.

Functions

Link copied to clipboard
open fun styleStateFor(entityId: EntityId): StyleState

Which StyleState should be rendered in while the engine is in this mode: StyleState.EDITING or StyleState.SELECTED for the one entity Edit/Select names, StyleState.DEFAULT for every other entity and every other mode. HOVER and DISABLED aren't derivable from a mode — nothing in the engine produces them yet.