Let a zoomed view fill the viewport rather than keep the photograph's shape
The view was the same fraction of each axis, so it kept the frame's aspect at every zoom: a portrait zoomed on a landscape screen stayed a portrait strip with the screen's sides empty. Each axis now shows as much of the frame as the viewport holds at that magnification, capped at the whole frame, and the render is fitted to the viewed region rather than to the frame. A redraw re-cuts a zoomed view about its centre when the viewport or the crop changes shape.
This commit is contained in:
@@ -860,7 +860,7 @@ mod tests {
|
||||
};
|
||||
|
||||
let (_, _, full_w, full_h) = session.overlay_clip();
|
||||
session.zoom_about(4.0, 0.5, 0.5);
|
||||
session.zoom_about(4.0, 0.5, 0.5, 64, 64);
|
||||
let (_, _, zoomed_w, zoomed_h) = session.overlay_clip();
|
||||
|
||||
assert!(
|
||||
@@ -878,7 +878,7 @@ mod tests {
|
||||
return;
|
||||
};
|
||||
|
||||
session.zoom_about(4.0, 0.5, 0.5);
|
||||
session.zoom_about(4.0, 0.5, 0.5, 64, 64);
|
||||
let (before_x, _, _, _) = session.overlay_clip();
|
||||
session.pan_by(0.3, 0.0);
|
||||
let (after_x, _, _, _) = session.overlay_clip();
|
||||
|
||||
Reference in New Issue
Block a user