FinishDrawing

data class FinishDrawing(val entityId: EntityId, val vertexIds: List<VertexId>) : DrawEvent

An explicit request (e.g. a host UI "Finish" button) to commit DrawMode.Draw's pendingVertices as a real entity. entityId and vertexIds are generated by the caller for the same reason DragEnd.newVertexId is: the reducer must stay pure, so it can't invent ids itself. vertexIds must have exactly one id per pending vertex — the caller reads pendingVertices.size from the current state right before dispatching this, so a mismatch means the state changed out from under it, and the reducer treats that as a no-op rather than guessing which ids belong to which point. Dispatched while not in DrawMode.Draw, or with too few points for the entity type, is also a no-op — a host should gate its "Finish" button on both, but the reducer doesn't trust it to.

Constructors

Link copied to clipboard
constructor(entityId: EntityId, vertexIds: List<VertexId>)

Properties

Link copied to clipboard
Link copied to clipboard