forked from 1b-agent/opencadstudio-upstream
fix(save): preserve 3D view and thumbnails
Persist camera, render state, and solid fallback geometry across saves. Generate previews from a clean live viewport and refresh recent-file thumbnails immediately.
This commit is contained in:
1 parent
c4515cbbc1
commit
e94cbedaa2
15 files changed
+658
-629
No files matched your search
+19
-4
@@ -204,7 +204,18 @@ impl Scene {
|
||||
Arc<Vec<HatchModel>>,
|
||||
Arc<Vec<ImageModel>>,
|
||||
) {
|
||||
let selected = self.selected_hatch_sig();
|
||||
self.paper_sheet_render_models_for_view(true)
|
||||
}
|
||||
|
||||
pub(super) fn paper_sheet_render_models_for_view(
|
||||
&self,
|
||||
tint_selected: bool,
|
||||
) -> (
|
||||
Arc<Vec<HatchModel>>,
|
||||
Arc<Vec<HatchModel>>,
|
||||
Arc<Vec<ImageModel>>,
|
||||
) {
|
||||
let selected = if tint_selected { self.selected_hatch_sig() } else { 0 };
|
||||
let reuse = {
|
||||
let cache = self.paper_sheet_render_cache.borrow();
|
||||
if let Some(cache) = cache.get(&self.current_layout) {
|
||||
@@ -259,7 +270,11 @@ impl Scene {
|
||||
if let Some(sheet) = self.paper_sheet_fill() {
|
||||
hatches.push(sheet);
|
||||
}
|
||||
hatches.extend(self.paper_canvas_hatches().iter().cloned());
|
||||
hatches.extend(
|
||||
self.paper_canvas_hatches(tint_selected)
|
||||
.iter()
|
||||
.cloned(),
|
||||
);
|
||||
let hatches = Arc::new(hatches);
|
||||
let wipeouts = self.paper_canvas_wipeouts();
|
||||
let images = self.paper_sheet_images();
|
||||
@@ -381,7 +396,7 @@ impl Scene {
|
||||
/// entity handle) rather than the already-flattened arc — the
|
||||
/// flattened arc carries pattern names, not handles, so filtering
|
||||
/// there is unreliable.
|
||||
pub fn paper_canvas_hatches(&self) -> Arc<Vec<HatchModel>> {
|
||||
fn paper_canvas_hatches(&self, tint_selected: bool) -> Arc<Vec<HatchModel>> {
|
||||
let layout_block = self.current_layout_block_handle();
|
||||
let layer_hidden = |layer: &str| {
|
||||
self.document
|
||||
@@ -455,7 +470,7 @@ impl Scene {
|
||||
}
|
||||
}
|
||||
}
|
||||
if self.selected.contains(&handle) {
|
||||
if tint_selected && self.selected.contains(&handle) {
|
||||
m.color = [0.15, 0.55, 1.00, m.color[3]];
|
||||
}
|
||||
models.push(m);
|
||||
|
||||
Reference in new issue
Block a user