zoom: bugfixes
This commit is contained in:
parent
c45a58c16c
commit
9042f0adf4
1 changed files with 6 additions and 4 deletions
|
|
@ -82,8 +82,7 @@ impl OutputZoomState {
|
||||||
cursor_position.to_local(&output)
|
cursor_position.to_local(&output)
|
||||||
}
|
}
|
||||||
ZoomMovement::Centered => {
|
ZoomMovement::Centered => {
|
||||||
let mut zoomed_output_geometry =
|
let mut zoomed_output_geometry = output.geometry().to_f64().downscale(level);
|
||||||
output.zoomed_geometry(level).unwrap().to_f64();
|
|
||||||
zoomed_output_geometry.loc =
|
zoomed_output_geometry.loc =
|
||||||
cursor_position - zoomed_output_geometry.size.downscale(2.).to_point();
|
cursor_position - zoomed_output_geometry.size.downscale(2.).to_point();
|
||||||
|
|
||||||
|
|
@ -307,8 +306,11 @@ impl ZoomState {
|
||||||
.loc
|
.loc
|
||||||
.to_local(&output)
|
.to_local(&output)
|
||||||
.upscale(
|
.upscale(
|
||||||
output_geometry.size.w
|
output_geometry
|
||||||
/ (output_geometry.size.w - zoomed_output_geometry.size.w),
|
.size
|
||||||
|
.w
|
||||||
|
.checked_div(output_geometry.size.w - zoomed_output_geometry.size.w)
|
||||||
|
.unwrap_or(1),
|
||||||
)
|
)
|
||||||
.to_global(&output);
|
.to_global(&output);
|
||||||
focal_point.x = focal_point.x.clamp(
|
focal_point.x = focal_point.x.clamp(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue