summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows
diff options
context:
space:
mode:
author antonioginer <antonioginer@users.noreply.github.com>2021-07-02 12:07:21 +0200
committer GitHub <noreply@github.com>2021-07-02 20:07:21 +1000
commit5186eaaff1a10d981f75a8d49cf1096ff2159356 (patch)
tree5e70cdf145e1dcdc573b8878e3bd2117c24c7dec /src/osd/windows
parentb59ede5db011abbb0c6df4fe4baa855883ab766e (diff)
Correctly apply -keepaspect with -unevenstretchx/y. (#8209)
* Correctly apply -keepaspect with -unevenstretchx/y. Initialize window at the correct size when -intscalex/y is used. * Get correct window size upon maximizing/minimizing with integer scaling.
Diffstat (limited to 'src/osd/windows')
-rw-r--r--src/osd/windows/window.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp
index cc9ff4484ba..ec549933956 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -1236,7 +1236,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
case WM_SIZING:
{
RECT *rect = (RECT *)lparam;
- if (window->keepaspect() && !(GetAsyncKeyState(VK_CONTROL) & 0x8000))
+ if (window->keepaspect() && (window->target()->scale_mode() == SCALE_FRACTIONAL) && !(GetAsyncKeyState(VK_CONTROL) & 0x8000))
{
osd_rect r = window->constrain_to_aspect_ratio(RECT_to_osd_rect(*rect), wparam);
rect->top = r.top();
@@ -1422,10 +1422,6 @@ osd_rect win_window_info::constrain_to_aspect_ratio(const osd_rect &rect, int ad
if (monitor == nullptr)
return rect;
- // do not constrain aspect ratio for integer scaled views
- if (target()->scale_mode() != SCALE_FRACTIONAL)
- return rect;
-
// get the pixel aspect ratio for the target monitor
pixel_aspect = monitor->pixel_aspect();
@@ -1551,7 +1547,7 @@ osd_dim win_window_info::get_min_bounds(int constrain)
minheight += wnd_extra_height();
// if we want it constrained, figure out which one is larger
- if (constrain && target()->scale_mode() == SCALE_FRACTIONAL)
+ if (constrain)
{
// first constrain with no height limit
osd_rect test1(0,0,minwidth,10000);
@@ -1611,7 +1607,7 @@ osd_dim win_window_info::get_max_bounds(int constrain)
maximum = maximum.resize(tempw, temph);
// constrain to fit
- if (constrain && target()->scale_mode() == SCALE_FRACTIONAL)
+ if (constrain)
maximum = constrain_to_aspect_ratio(maximum, WMSZ_BOTTOMRIGHT);
return maximum.dim();