fix: Wipeout fill color respects BACKGROUND command override

Scene now carries bg_color / paper_bg_color fields (defaults match
previous hard-coded values). synced_hatch_models() reads these instead
of hard-coded constants, so Wipeout fills correctly use the custom
background when BACKGROUND <r> <g> <b> has been set.
BACKGROUND command syncs both DocumentTab.bg_color and scene.bg_color.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-04-06 23:32:11 +03:00
commit 5d0edb3a1f
2 changed files with 13 additions and 2 deletions

View file

@ -41,8 +41,10 @@ impl H7CAD {
if args.first().map(|s| s.eq_ignore_ascii_case("RESET")).unwrap_or(false) {
if is_paper {
self.tabs[i].paper_bg_color = None;
self.tabs[i].scene.paper_bg_color = [0.22, 0.24, 0.28, 1.0];
} else {
self.tabs[i].bg_color = None;
self.tabs[i].scene.bg_color = [0.11, 0.11, 0.11, 1.0];
}
self.command_line.push_output("Background reset to default.");
} else if args.len() >= 3 {
@ -51,8 +53,10 @@ impl H7CAD {
let b = args[2].parse::<u8>().unwrap_or(0) as f32 / 255.0;
if is_paper {
self.tabs[i].paper_bg_color = Some([r, g, b, 1.0]);
self.tabs[i].scene.paper_bg_color = [r, g, b, 1.0];
} else {
self.tabs[i].bg_color = Some([r, g, b, 1.0]);
self.tabs[i].scene.bg_color = [r, g, b, 1.0];
}
self.command_line
.push_output(&format!("Background: rgb({}, {}, {})", args[0], args[1], args[2]));