Merge pull request #916 from pravdomil/claude/composition-maximize-zoom-fit-86627e

Viewer: Fit up to 100% follows the panel size

# Conflicts:
#	crates/ui-egui/src/panels/viewer_tools.rs
#	crates/ui-egui/tests/ui_viewer.rs
This commit is contained in:
Brandon Thomas
2026-10-12 04:22:53 -04:00
6 changed files with 68 additions and 14 deletions
+4 -3
View File
@@ -122,10 +122,11 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
// Bottom bar: magnification and View menus.
p.rect_filled(bar, 0.0, t.panel_bg);
let mr = Rect::from_min_size(pos2(bar.min.x + 8.0, bar.center().y - 10.0), vec2(80.0, 20.0));
if let Some(z) =
super::viewer_tools::magnification_menu(app, ui, mr, "layer-mag", "layerPanel.magnification", "layerMagnification", zoom as f32, app.ui.layer_zoom, fit)
if let Some((z, up)) =
super::viewer_tools::magnification_menu(app, ui, mr, "layer-mag", "layerPanel.magnification", "layerMagnification", zoom as f32, app.ui.layer_zoom, false)
{
app.ui.layer_zoom = z;
// The Layer panel keeps no fit mode: Fit up to 100% is the fit, at most 100 %.
app.ui.layer_zoom = if up { Some(fit.min(1.0 / ui.ctx().pixels_per_point())) } else { z };
app.ui.layer_pan = [0.0, 0.0];
}
let vx = mr.max.x + 10.0;