A cursor allows for efficiently scanning through a collection of overlapping intervals (which
we call “spans”). It is optimized for the case where you need to repeatedly move the current
position by a little bit in either direction; in this case, the complexity is O(n),
where n is the number of “active” spans that overlap the times you’re interested in.
While drawing, this stores one continuous poly-line (from pen-down to
pen-up). Because we expect lots of fast changes to this, it uses interior
mutability to avoid repeated allocations.
A StrokeSeq is a sequence of strokes, each of which is a continuous curve. Each stroke can
have its own style (thickness, color, effects). The strokes in a StrokeSeq are non-decreasing
in time: one stroke ends before another begins.