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
@@ -2100,6 +2100,12 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
app.viewport.rect = Some(rect);
|
||||
refresh_layout(app, ui.ctx().pixels_per_point());
|
||||
let resp = ui.interact(rect, ui.id().with("viewport"), Sense::click_and_drag());
|
||||
let flat = crate::dialogs_sheet::flat_active(app);
|
||||
if !flat {
|
||||
app.flat_view.fitted = false;
|
||||
}
|
||||
let input =
|
||||
if flat { crate::dialogs_sheet::navigate(app, ui, rect, &resp) } else { crate::navigation::handle(app, ui, rect, &resp, NavCaps::MODEL) };
|
||||
let CameraInput {
|
||||
hover,
|
||||
scroll,
|
||||
@@ -2115,7 +2121,7 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
pan,
|
||||
primary_nav,
|
||||
mode,
|
||||
} = crate::navigation::handle(app, ui, rect, &resp, NavCaps::MODEL);
|
||||
} = input;
|
||||
app.viewport.physical_scale = ui.ctx().pixels_per_point();
|
||||
let proj = projection(app, rect);
|
||||
if let Ok(mut cache) = app.viewport.display.lock() {
|
||||
|
||||
Reference in new issue
Block a user