From 7615bfdfb3611d7bc8097c769c2e703f78754fa8 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 29 Dec 2022 20:32:03 +0200 Subject: [PATCH] Set a minimum for resizing a window --- GUI/GraphicalUserInterface.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/GUI/GraphicalUserInterface.cpp b/GUI/GraphicalUserInterface.cpp index b0e1a4b..7d76510 100644 --- a/GUI/GraphicalUserInterface.cpp +++ b/GUI/GraphicalUserInterface.cpp @@ -394,10 +394,24 @@ namespace GraphicalUserInterface { wnd->GetPositionPtr()->Width += Mouse.X - MouseArray[0].X; wnd->GetPositionPtr()->Height += Mouse.Y - MouseArray[0].Y; + + if (wnd->GetPositionPtr()->Width < 200) + { + wnd->GetPositionPtr()->Width = 200; + Mouse.X = MouseArray[0].X; + } + + if (wnd->GetPositionPtr()->Height < 100) + { + wnd->GetPositionPtr()->Height = 100; + Mouse.Y = MouseArray[0].Y; + } + OverlayBufferRepaint = true; OverlayFullRepaint = true; eTemplate.Resize.Width = wnd->GetPosition().Width; eTemplate.Resize.Height = wnd->GetPosition().Height; + wnd->OnResize(&eTemplate); } }