fix(render): draw current trace attributes after an edit#102
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.