Skip to content

Simplified Caching and forced dirty if geometry is null - #33

Merged
carl-andersson-at-westermo merged 2 commits into
mainfrom
fix/edge-caching
Sep 11, 2026
Merged

carl-andersson-at-westermo merged 2 commits into
mainfrom
fix/edge-caching

Conversation

@carl-andersson-at-westermo

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

One or more issues must be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Simplifies edge geometry caching by hashing computed points and updates related tests.

Changes:

  • Replaces the detailed geometry-input signature with a point hash.
  • Refactors routed point updates and self-loop geometry preparation.
  • Adjusts caching and batched-rendering tests.
File summaries
File Description
Westermo.GraphX.Controls.Avalonia/Controls/EdgeControlBase.cs Updated as part of this pull request.
Westermo.GraphX.Controls.Avalonia.Tests/GeometryCachingTests.cs Updated as part of this pull request.
Westermo.GraphX.Controls.Avalonia.Tests/BatchedEdgeRenderingTests.cs Updated as part of this pull request.
Review details

Suppressed comments (1)

Westermo.GraphX.Controls.Avalonia/Controls/EdgeControlBase.cs:807

  • For a self-loop using PART_SelfLoopedEdge, PrepareSelfLoopedEdge deliberately returns null, so LineGeometry remains null by design. This condition consequently marks the edge dirty on every invalidated measure, reruns PrepareEdgeLayout, and notifies the batched renderer even though the custom indicator is the rendered visual. Distinguish an expected null custom-template path from a failed geometry build, or retain a separate successful-layout state, to avoid this repeated work.
        _isGeometryDirty = LineGeometry is null || changed;
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Westermo.GraphX.Controls.Avalonia/Controls/EdgeControlBase.cs
Comment thread Westermo.GraphX.Controls.Avalonia/Controls/EdgeControlBase.cs

@kngrektor kngrektor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably rename signature to hash

@carl-andersson-at-westermo
carl-andersson-at-westermo merged commit dfa2579 into main Sep 11, 2026
4 checks passed
@carl-andersson-at-westermo
carl-andersson-at-westermo deleted the fix/edge-caching branch September 11, 2026 11:41
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.

3 participants