From e508e8a3f9dc258b411d78703897a117213c5c0f Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 25 Jun 2020 15:07:18 +0200 Subject: windows: more lenient with resizing very large views in windowed mode (nw) --- src/osd/windows/window.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index 8e723ea6246..d3c9dd5b9a9 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -1498,14 +1498,6 @@ osd_rect win_window_info::constrain_to_aspect_ratio(const osd_rect &rect, int ad // get the minimum width/height for the current layout m_target->compute_minimum_size(minwidth, minheight); - // clamp against the absolute minimum - propwidth = std::max(propwidth, MIN_WINDOW_DIM); - propheight = std::max(propheight, MIN_WINDOW_DIM); - - // clamp against the minimum width and height - propwidth = std::max(propwidth, minwidth); - propheight = std::max(propheight, minheight); - // clamp against the maximum (fit on one screen for full screen mode) if (fullscreen()) { @@ -1517,13 +1509,25 @@ osd_rect win_window_info::constrain_to_aspect_ratio(const osd_rect &rect, int ad maxwidth = monitor->usuable_position_size().width() - extrawidth; maxheight = monitor->usuable_position_size().height() - extraheight; - // further clamp to the maximum width/height in the window + // clamp minimum against half of maximum to allow resizing very large targets (eg. SVG screen) + minwidth = std::min(minwidth, maxwidth / 2); + minheight = std::min(minheight, maxheight / 2); + + // clamp maximum to the maximum width/height in the window if (m_win_config.width != 0) maxwidth = std::min(maxwidth, m_win_config.width + extrawidth); if (m_win_config.height != 0) maxheight = std::min(maxheight, m_win_config.height + extraheight); } + // clamp against the absolute minimum + propwidth = std::max(propwidth, MIN_WINDOW_DIM); + propheight = std::max(propheight, MIN_WINDOW_DIM); + + // clamp against the minimum width and height + propwidth = std::max(propwidth, minwidth); + propheight = std::max(propheight, minheight); + // clamp to the maximum propwidth = std::min(propwidth, maxwidth); propheight = std::min(propheight, maxheight); -- cgit v1.2.3