Skip to content

fix(render): draw current trace attributes after an edit#102

Merged
quasiTriestino merged 1 commit into
mainfrom
fix/trace-attributes-stale-render
Jul 21, 2026
Merged

fix(render): draw current trace attributes after an edit#102
quasiTriestino merged 1 commit into
mainfrom
fix/trace-attributes-stale-render

Conversation

@dustenhubbard

Copy link
Copy Markdown
Member

The incremental field render could keep drawing a trace's old color, name, tags, or fill after an attribute edit, until a pan or zoom forced a full redraw. This validates the cached on-screen traces and rebuilds when one is stale, while selection-only refreshes keep the fast path.

Closes #101.

After changing a trace's color (or name, tags, or fill), the field kept
drawing the trace with its previous attributes until the view was
panned, zoomed, or otherwise fully redrawn, and the selection highlight
could disagree with the drawn line.

The incremental render path in TraceLayer.generateTraceLayer
(window_moved=False) reuses a cached traces_in_view list of trace
objects and reconciles it only through section.added_traces and
section.removed_traces. Section.editTraceAttributes does not mutate a
trace in place; it removes the trace and adds a fresh copy. A table
refresh then calls section.clearTracking(), which empties the add and
remove lists, so a following incremental render still holds the old,
replaced object and draws its stale attributes.

Detect any cached on-screen trace that is no longer a live member of its
contour and fall back to a full tracesAsList() rebuild so current
attributes are drawn. Only the on-screen traces are checked, so a
selection-only refresh stays on the fast path and does not rebuild.
@quasiTriestino
quasiTriestino merged commit d198a50 into main Jul 21, 2026
@quasiTriestino
quasiTriestino deleted the fix/trace-attributes-stale-render branch July 21, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trace keeps its old color after an attribute edit until the field is redrawn

2 participants