Rescale both axes by f about a world position.
f < 1 zooms in, f > 1 out; data under cursor stays in place.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | cx |
x of fixed point, in world coords. |
||
| real(kind=real64), | intent(in) | :: | cy |
y of fixed point, in world coords. |
||
| real(kind=real64), | intent(in) | :: | f |
Factor applied to world-space spans. |
subroutine zoom_at(cx, cy, f) !! Rescale both axes by `f` about a world position. !! !! `f` < 1 zooms in, `f` > 1 out; data under cursor stays in place. ! Arguments real(real64), intent(in) :: cx !! x of fixed point, in world coords. real(real64), intent(in) :: cy !! y of fixed point, in world coords. real(real64), intent(in) :: f !! Factor applied to world-space spans. real(real64) :: a, b a = xtrans(st%xmin); b = xtrans(st%xmax) st%xmin = inv_x(cx + (a - cx)*f) st%xmax = inv_x(cx + (b - cx)*f) a = ytrans2(st%ymin); b = ytrans2(st%ymax) st%ymin = inv_y(cy + (a - cy)*f) st%ymax = inv_y(cy + (b - cy)*f) st%xauto = .false.; st%yauto = .false. end subroutine zoom_at