From 5c90352ae6b3d86f1ad70e2d47b9898cccc3f372 Mon Sep 17 00:00:00 2001 From: maniak1349 Date: Tue, 26 Apr 2016 04:46:11 +0300 Subject: 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) --- video/out/w32_common.c | 6 +++--- 1 file 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; -- cgit v1.2.3