Viewer: Fit up to 100% follows the panel size

Magnification ▸ Fit up to 100% stored the magnification of the moment it
was picked, so the comp kept that size when the panel was maximized or
resized. It is now a fit mode like Fit, capped at 100%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pravdomil
2026-10-11 22:21:52 +02:00
co-authored by Claude Opus 5.5
parent 67434e9038
commit a78961a346
5 changed files with 56 additions and 7 deletions
+3
View File
@@ -273,6 +273,8 @@ impl Resolution {
pub struct ViewerState {
/// Magnification (1 = 100%); None = fit.
pub zoom: Option<f32>,
/// Fit up to 100%: while fitting (`zoom` is None), the comp is never magnified past 100%.
pub fit_up_to_100: bool,
/// Pan offset in points from the centred position.
pub pan: [f32; 2],
pub res: Resolution,
@@ -313,6 +315,7 @@ impl Default for ViewerState {
fn default() -> Self {
ViewerState {
zoom: None,
fit_up_to_100: false,
pan: [0.0, 0.0],
res: Resolution::Auto,
transparency_grid: false,