DragStart

data class DragStart(val position: GeoPosition, val hitVertexId: VertexId?, val hitEntityId: EntityId?, val hitEdgeIndex: Int? = null, val hitDraftPointIndex: Int? = null, val hitDraftEdgeIndex: Int? = null, val hitMarker: Boolean = false, val hitSpanPrevId: VertexId? = null, val hitSpanNextId: VertexId? = null, val hitRingIndex: Int = 0) : DrawEvent

A drag gesture begins at position. hitEntityId identifies which shape (if any) was grabbed. Exactly one of hitVertexId (an existing vertex) or hitEdgeIndex (a midpoint handle, not yet a real vertex — see DrawMode.Edit.ActiveDrag.NewVertex) should be set for a drag the reducer acts on; both null (with hitEntityId also often null) means empty space or a whole-shape grab this library doesn't support yet.

While a shape is still being drawn (DrawMode.Draw) there is no entity and no vertex ids, so the draft's own points are addressed by index instead: hitDraftPointIndex is a point of the draft, hitDraftEdgeIndex a midpoint handle on one of its edges.

A marker has no vertices, so grabbing the marker being edited (hitMarker, with hitEntityId) is how it is moved.

When only some of a shape's vertices have a handle (the others are hidden between them), hitSpanPrevId/hitSpanNextId name the handled vertices on either side of hitVertexId; dragging it then also moves the hidden vertices in between, in proportion (see com.tcsappdev.worldwinddraw.core.geometry.SpanMover). Both null is an ordinary one-vertex drag.

hitRingIndex is which ring of a polygon hitEdgeIndex is an edge of (0, the first, for a shape with only one).

Constructors

Link copied to clipboard
constructor(position: GeoPosition, hitVertexId: VertexId?, hitEntityId: EntityId?, hitEdgeIndex: Int? = null, hitDraftPointIndex: Int? = null, hitDraftEdgeIndex: Int? = null, hitMarker: Boolean = false, hitSpanPrevId: VertexId? = null, hitSpanNextId: VertexId? = null, hitRingIndex: Int = 0)

Properties

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