diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-08-08 17:03:44 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-08-20 23:15:48 +0000 |
commit | 7d6f9e37397ed57be0f1375afe8fddfc451aa152 (patch) | |
tree | 0dbc3c765a408359afff70e6d771c97a3d68cc44 /video/out/aspect.c | |
parent | 56ec3ea9f64e2434983f1aadf0241cc6cd09dc83 (diff) | |
download | mpv-7d6f9e37397ed57be0f1375afe8fddfc451aa152.tar.bz2 mpv-7d6f9e37397ed57be0f1375afe8fddfc451aa152.tar.xz |
aspect: change --video-pan-x/y to be relative to the destination rect
It makes it more usable to virtually move dst rect instead of scaled
src.
The issue with the latter is that it is affected by video-zoom
paramters. For example if we do `--video-pan-x=-0.5` in normal case it
will move video -50%, but if we apply video-zoom/scale the video will
float towards the middle in unintuitive way. Extreme case is when one do
--video-zoom-x=0.01, now it is impossible to move video unless you
specify huge video-pan-x value, but it is limited to [-3, 3]. So you
cannot do anything.
With this changes regardless of video scale/zoom, video-pan will keep
center of scaled video in one place.
Diffstat (limited to 'video/out/aspect.c')
-rw-r--r-- | video/out/aspect.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/aspect.c b/video/out/aspect.c index b3e91fd73c..5317481765 100644 --- a/video/out/aspect.c +++ b/video/out/aspect.c @@ -88,7 +88,7 @@ static void src_dst_split_scaling(int src_size, int dst_size, *src_start = 0; *src_end = src_size; - *dst_start = (dst_size - scaled_src_size) * align + pan * scaled_src_size; + *dst_start = (dst_size - scaled_src_size) * align + pan * dst_size; *dst_end = *dst_start + scaled_src_size; // Distance of screen frame to video |