forked from 1b-agent/opencadstudio-upstream
fix(paper): give the sheet back its desk and its edge
A paper layout painted its whole canvas in the page colour, so the sheet had no visible edge — zooming out never reached one, because the surround was the same colour as the page. Floating viewports then painted themselves black over it. Both come from the same idea, that a viewport's canvas is a colour it can be handed. What lies behind a viewport depends on what the viewport is: - The full-canvas sheet shows the desk. `paper_bg_color` is the page, and the page is a bounded rectangle `paper_sheet_fill` already draws; using it for the canvas too erased the boundary between them. The desk is now its own colour, defined once in the scene and read by both the widget and the renderer, so the two cannot drift apart. - A floating viewport sits on that sheet and must paint no canvas at all. Handing it a transparent one does not work: the background shader returns an opaque colour whatever alpha it is given, so alpha zero came out black. Skipping the pass is the only way to ask for see-through, so `skip_background` now suppresses both the clear and the pass. It is part of the frame signature too — without that, a cached frame would keep showing the canvas the flag was just turned off for. Shading and fog still blend toward what is behind a floating viewport, which is the page, so the uniform keeps that colour even though nothing paints it. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
1 parent
6cbec232bb
commit
62dfbfe2be
4 files changed
+45
-9
No files matched your search
+6
-4
@@ -34,11 +34,13 @@ use viewcube::{viewcube_nav_controls, viewcube_ucs_picker, UCS_PICKER_W};
|
||||
pub(in crate::app) use overlay::{MTEXT_TEXT_ID, TEXT_INLINE_ID};
|
||||
|
||||
const VIEWCUBE_HIT_SIZE: f32 = VIEWCUBE_REGION_PX;
|
||||
/// The desk shown around the sheet, as the widget wants it. One definition,
|
||||
/// shared with the renderer that clears the sheet viewport to the same thing.
|
||||
const PAPER_SPACE_BACKGROUND: Color = Color {
|
||||
r: 138.0 / 255.0,
|
||||
g: 138.0 / 255.0,
|
||||
b: 138.0 / 255.0,
|
||||
a: 1.0,
|
||||
r: crate::scene::PAPER_DESK_COLOR[0],
|
||||
g: crate::scene::PAPER_DESK_COLOR[1],
|
||||
b: crate::scene::PAPER_DESK_COLOR[2],
|
||||
a: crate::scene::PAPER_DESK_COLOR[3],
|
||||
};
|
||||
|
||||
/// Base surface directly under the crosshair. Paper content viewports render
|
||||
|
||||
Reference in new issue
Block a user