forked from 1b-agent/opencadstudio-upstream
fix: restore paper-space viewport rendering as single full-canvas widget
Iced 0.14 batches all shader prepare() calls before any render() calls. Multiple ViewportPane widgets sharing the same Pipeline type overwrite each other's GPU buffers, causing the PaperSheet layer (full-canvas) to render the last viewport's model content — appearing full-screen. Fix: paper_canvas_view() now renders a single full-canvas PaperSheet widget. build_paper_sheet_primitive() is updated to include model-space content projected through each viewport's view matrix (via viewport_content_wires()), restoring the original working behaviour. ViewportPane::Paper mode and viewport_screen_rect() are kept with #[allow(dead_code)] — a per-viewport wgpu sub-renderer that accumulates data across frames could revive them in the future. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
592e3da6ac
commit
d1d4bb3d02
4 files changed
+33
-62
No files matched your search
+5
-4
@@ -196,10 +196,9 @@ impl Scene {
|
||||
}
|
||||
}
|
||||
|
||||
/// Build a Primitive for the paper-sheet background: paper-space entities
|
||||
/// (title blocks, frames, borders) using the paper-space camera.
|
||||
/// Viewport content is NOT included — it is rendered by separate
|
||||
/// `ViewportPane::Paper` widgets stacked on top.
|
||||
/// Build a Primitive for the full paper canvas: paper-space entities
|
||||
/// (title blocks, frames, borders) plus model-space content projected
|
||||
/// through each viewport's view matrix into paper-space coordinates.
|
||||
pub(super) fn build_paper_sheet_primitive(
|
||||
&self,
|
||||
hover_region: Option<usize>,
|
||||
@@ -208,7 +207,9 @@ impl Scene {
|
||||
let cam = self.camera.borrow();
|
||||
self.selection.borrow_mut().vp_size = (bounds.width, bounds.height);
|
||||
|
||||
let layout_block = self.current_layout_block_handle();
|
||||
let mut wires = self.paper_sheet_wires();
|
||||
wires.extend(self.viewport_content_wires(layout_block, None));
|
||||
if let Some(iw) = &self.interim_wire {
|
||||
wires.push(iw.clone());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user