mirror of https://github.com/mpv-player/mpv
Implement keepaspect for Windows OpenGL vos.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25950 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
949787e410
commit
8b068da7ad
|
@ -61,6 +61,18 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||
vo_dheight = r.bottom;
|
||||
break;
|
||||
case WM_WINDOWPOSCHANGING:
|
||||
if (vo_keepaspect && !vo_fs) {
|
||||
WINDOWPOS *wpos = lParam;
|
||||
int xborder, yborder;
|
||||
RECT r2;
|
||||
GetClientRect(vo_window, &r);
|
||||
GetWindowRect(vo_window, &r2);
|
||||
xborder = (r2.right - r2.left) - (r.right - r.left);
|
||||
yborder = (r2.bottom - r2.top) - (r.bottom - r.top);
|
||||
wpos->cx -= xborder; wpos->cy -= yborder;
|
||||
aspect_fit(&wpos->cx, &wpos->cy, wpos->cx, wpos->cy);
|
||||
wpos->cx += xborder; wpos->cy += yborder;
|
||||
}
|
||||
return 0;
|
||||
case WM_CLOSE:
|
||||
mplayer_put_key(KEY_CLOSE_WIN);
|
||||
|
|
Loading…
Reference in New Issue