fix: correct entity color adaptation for viewport content in paper space

Model-space entities shown through a viewport were tessellated using
paper_bg_color (light), but the interactive viewport pane renders them
on bg_color (dark), causing white/black entities to appear incorrectly.

- model_wires_for_viewport: tessellate with bg_color so the viewport
  pane (dark background) gets correctly adapted entity colors
- viewport_content_wires: re-adapt projected wire colors using
  paper_bg_color before rendering onto the paper canvas

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Sonnet 4.6 committed 2026-04-30 21:39:38 +03:00
1 parent 678909bdf7
commit 00e61a1301
1 file changed
+10 -2
+10 -2
View File
@@ -914,7 +914,8 @@ impl Scene {
continue;
}
let [r, g, b, a] = wire.color;
let adapted = render::adapt_to_bg(wire.color, self.paper_bg_color);
let [r, g, b, a] = adapted;
let mut out = wire.clone();
out.points = clipped;
out.color = [r * 0.80, g * 0.80, b * 0.80, a * 0.85];
@@ -2559,7 +2560,14 @@ impl Scene {
}
true
})
.flat_map(|e| self.tessellate_one(e))
.flat_map(|e| tessellate_entity(
&self.document,
&self.selected,
self.active_viewport,
self.world_offset,
self.bg_color,
e,
))
.collect()
}