perf: Arc-cache paper_canvas_wires() to eliminate O(N) clone on navigation

paper_canvas_wires() now returns Arc<Vec<WireModel>> backed by
paper_canvas_cache (epoch-keyed). Pan/zoom frames hit the cache and
return a pointer copy; only geometry changes rebuild the wire list.
Completes the paper-canvas caching chain (L+M): sheet cache →
projected-per-viewport cache → full canvas Arc cache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-04-26 16:30:21 +03:00
commit 52c830e477
2 changed files with 18 additions and 3 deletions

View file

@ -100,7 +100,7 @@ impl<'a> canvas::Program<Message> for PaperCanvas<'a> {
};
// ── Wires (entity lines + inactive viewport projections) ──────────────
for wire in &self.scene.paper_canvas_wires() {
for wire in self.scene.paper_canvas_wires().iter() {
let [r, g, b, a] = wire.color;
let color = Color { r, g, b, a };