ReadonlyidReadonlypointsStatic ReadonlyKINDTrue once requiredPoints clicks have been collected.
True when the drawing's rendered geometry does NOT depend on its anchor
index/time — e.g. a full-width horizontal price level. Such drawings stay
visible (and selectable) under a replay cap even when their stored anchor
index sits past the revealed prefix, because the index is cosmetic for
them. Index/time-dependent drawings (the default) are hidden once every
anchor is past the cap, so a not-yet-revealed shape never leaks. Subclasses
whose render ignores the index override this to true.
Unique discriminator used in snapshots. Subclasses override.
How many clicks are needed before the drawing is "complete".
Add a point to the drawing if still incomplete. No-op otherwise.
Hit-test a screen point (in canvas pixels) against this drawing for
selection. Returns true when the point is within tolerance pixels of
the rendered geometry.
The default implementation treats the anchors as a polyline (correct for segment shapes like TrendLine and Arrow). Shapes whose rendered geometry differs from a simple anchor polyline — full-width/height lines, rectangles, rays, channels, fib levels — override this.
Render the drawing into the canvas.
Restore the numeric payload produced by snapshotData. Called by the snapshot factory after the anchors are populated. No-op in the base class.
ProtectedsnapshotOptional numeric payload persisted alongside the anchors. The base class emits nothing; subclasses that derive geometry from sampled data (regression channel) override this so the snapshot round-trips exactly. Mirrors restoreData.
Replace the last anchor — useful for "live preview" drag feedback.
Equidistant channel — three anchor points: two on one boundary (defining the channel slope), one on the parallel boundary. The second boundary is rendered as a parallel line offset by the vertical distance between A→B and C (measured in price-space at C's index).
Anchors: A, B → the first (primary) boundary line C → a single point on the parallel boundary
The fill between the two lines is translucent (8% alpha) so overlapping channels remain readable.