summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaniak1349 <maniak1349@gmail.com>2016-04-26 04:46:11 +0300
committerwm4 <wm4@nowhere>2016-04-30 18:55:09 +0200
commit5c90352ae6b3d86f1ad70e2d47b9898cccc3f372 (patch)
treee8a539b66ed5f13c0e6d826e4d018096a3a4f1ad
parent0826b78bc59f7b16e158c9545c76b65c23719e0a (diff)
downloadmpv-5c90352ae6b3d86f1ad70e2d47b9898cccc3f372.tar.bz2
mpv-5c90352ae6b3d86f1ad70e2d47b9898cccc3f372.tar.xz
w32_common: fix size calculations for window resize
Substraction of 1 is not necessary due to .right and .bottom values of RECT struct describing a point one pixel outside of the rectangle. Fixes #2935. (2.b)
-rw-r--r--video/out/w32_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index d26de3b079..0398b08fda 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -1069,13 +1069,13 @@ static void reinit_window_state(struct vo_w32_state *w32)
add_window_borders(w32->window, &r);
if (!w32->current_fs &&
- ((r.right - r.left) >= screen_w || (r.bottom - r.top) >= screen_h))
+ ((r.right - r.left) > screen_w || (r.bottom - r.top) > screen_h))
{
MP_VERBOSE(w32, "requested window size larger than the screen\n");
// Use the aspect of the client area, not the full window size.
// Basically, try to compute the maximum window size.
- long n_w = screen_w - (r.right - cr.right) - (cr.left - r.left) - 1;
- long n_h = screen_h - (r.bottom - cr.bottom) - (cr.top - r.top) - 1;
+ long n_w = screen_w - (r.right - cr.right) - (cr.left - r.left);
+ long n_h = screen_h - (r.bottom - cr.bottom) - (cr.top - r.top);
// Letterbox
double asp = (cr.right - cr.left) / (double)(cr.bottom - cr.top);
double s_asp = n_w / (double)n_h;