feat: A4 landscape default paper, white paper area on dark desk

- paper_limits() falls back to A4 landscape (297×210mm) even when no
  Layout object exists in the document
- paper_bg_color default changed to white [1,1,1,1] (paper surface color)
- PaperCanvas::draw() fills canvas with dark desk color first, then draws
  the paper area rectangle in paper_bg_color so the sheet is clearly
  visible against the desk background
- view.rs container background uses the fixed desk color instead of
  paper_bg_color so it no longer conflicts with the paper-surface color
- BACKGROUND RESET for paper space now resets to white instead of dark gray
- Removed unused PaperSheet variant, paper_sheet() constructor,
  build_paper_sheet_primitive() and associated match arms (dead code
  after 2D canvas replacement)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-04-23 14:05:07 +03:00
commit 0a291c877b
6 changed files with 23 additions and 56 deletions

View file

@ -41,7 +41,7 @@ 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];
self.tabs[i].scene.paper_bg_color = [1.0, 1.0, 1.0, 1.0];
} else {
self.tabs[i].bg_color = None;
self.tabs[i].scene.bg_color = [0.11, 0.11, 0.11, 1.0];

View file

@ -232,9 +232,8 @@ impl H7CAD {
.height(Fill);
let bg_color = if is_paper {
tab.paper_bg_color
.map(|[r, g, b, a]| Color { r, g, b, a })
.unwrap_or(Color { r: 0.22, g: 0.24, b: 0.28, a: 1.0 })
// Desk color — matches the DESK constant in paper_canvas.rs.
Color { r: 0.22, g: 0.24, b: 0.28, a: 1.0 }
} else {
tab.bg_color
.map(|[r, g, b, a]| Color { r, g, b, a })