Flat pattern gets its own pan and zoom through the shared navigation (#1484)
The flat pattern now keeps a 2D view of its own, driven by navigation::handle with orbit off, so pan, zoom to the cursor and reverse zoom follow the navigation preset. Input over it no longer reaches the Design camera, and Fit and Home frame the pattern. Closes #1483.
This commit is contained in:
1 parent
6ad391fd75
commit
e20cf1858a
5 files changed
+297
-17
No files matched your search
@@ -363,6 +363,8 @@ pub struct SolveApp {
|
||||
styled: bool,
|
||||
fitted: bool,
|
||||
pending_fit: Option<(Camera, solidcraft_engine::geom::Aabb3, bool)>,
|
||||
/// The sheet metal flat pattern's own pan and zoom.
|
||||
pub flat_view: dialogs_sheet::FlatView,
|
||||
/// The start page.
|
||||
pub home: home::HomeState,
|
||||
pub file_load: file_load::FileLoad,
|
||||
@@ -448,6 +450,7 @@ impl SolveApp {
|
||||
styled: false,
|
||||
fitted: false,
|
||||
pending_fit: None,
|
||||
flat_view: Default::default(),
|
||||
home: home::HomeState::default(),
|
||||
file_load: file_load::FileLoad::default(),
|
||||
docs: documents::Documents::default(),
|
||||
@@ -986,6 +989,10 @@ impl SolveApp {
|
||||
}
|
||||
|
||||
pub fn fit_view(&mut self) {
|
||||
if dialogs_sheet::flat_active(self) {
|
||||
self.flat_view.fitted = false;
|
||||
return;
|
||||
}
|
||||
if render_workspace::active(self) {
|
||||
self.cancel_view_animation();
|
||||
match solidcraft_engine::product_scene::extract(&self.session) {
|
||||
@@ -1073,6 +1080,10 @@ impl SolveApp {
|
||||
|
||||
/// Frame everything shown, keeping the orientation (animated; the selection is ignored).
|
||||
pub fn animate_fit_all(&mut self) {
|
||||
if dialogs_sheet::flat_active(self) {
|
||||
self.animate_view("fit");
|
||||
return;
|
||||
}
|
||||
if render_workspace::active(self) {
|
||||
// The Render preview frames its product scene (see `fit_view`).
|
||||
self.fit_view();
|
||||
@@ -1087,6 +1098,11 @@ impl SolveApp {
|
||||
|
||||
/// Animated view changes for the axis view and navigation bar.
|
||||
pub fn animate_view(&mut self, v: &str) {
|
||||
// The flat pattern is a 2D view: Fit and Home frame it, and the Design camera stays put.
|
||||
if dialogs_sheet::flat_active(self) && matches!(v, "fit" | "home") {
|
||||
self.flat_view.fitted = false;
|
||||
return;
|
||||
}
|
||||
if render_workspace::active(self) && matches!(v, "fit" | "home") {
|
||||
if v == "home" {
|
||||
self.cam.set_view(StandardView::Iso);
|
||||
|
||||
Reference in new issue
Block a user