diff --git a/Windows/GEDebugger/SimpleGLWindow.cpp b/Windows/GEDebugger/SimpleGLWindow.cpp index d254273095..e73074bb7d 100644 --- a/Windows/GEDebugger/SimpleGLWindow.cpp +++ b/Windows/GEDebugger/SimpleGLWindow.cpp @@ -322,7 +322,7 @@ void SimpleGLWindow::GetContentSize(float &x, float &y, float &fw, float &fh) { x = 0.0f; y = 0.0f; - if (flags_ & (RESIZE_SHRINK_FIT | RESIZE_CENTER) && !zoom_) { + if ((flags_ & RESIZE_SHRINK_FIT) != 0 && !zoom_) { float wscale = fw / w_, hscale = fh / h_; // Too wide, and width is the biggest problem, so scale based on that. @@ -334,6 +334,17 @@ void SimpleGLWindow::GetContentSize(float &x, float &y, float &fw, float &fh) { fh = (float)h_; } } + if ((flags_ & RESIZE_GROW_FIT) != 0) { + float wscale = fw / w_, hscale = fh / h_; + + if (wscale > hscale && wscale < 1.0f) { + fw = (float)w_; + fh /= wscale; + } else if (hscale > wscale && hscale < 1.0f) { + fw /= hscale; + fh = (float)h_; + } + } if (flags_ & RESIZE_CENTER) { x = ((float)w_ - fw) / 2; y = ((float)h_ - fh) / 2; diff --git a/Windows/GEDebugger/SimpleGLWindow.h b/Windows/GEDebugger/SimpleGLWindow.h index 4dbec00184..26ebbcbea9 100644 --- a/Windows/GEDebugger/SimpleGLWindow.h +++ b/Windows/GEDebugger/SimpleGLWindow.h @@ -46,11 +46,16 @@ struct SimpleGLWindow { enum Flags { RESIZE_NONE = 0x00, - RESIZE_CENTER = 0x02, - RESIZE_SHRINK_FIT = 0x01, + RESIZE_CENTER = 0x01, + RESIZE_SHRINK_FIT = 0x02, RESIZE_SHRINK_CENTER = 0x03, + RESIZE_GROW_FIT = 0x04, + RESIZE_GROW_CENTER = 0x05, + RESIZE_BEST_FIT = 0x06, + RESIZE_BEST_CENTER = 0x07, + ALPHA_IGNORE = 0x00, - ALPHA_BLEND = 0x04, + ALPHA_BLEND = 0x08, }; SimpleGLWindow(HWND wnd);