From d4e1be39ad14f95ef7cca6860a79b424fc3f7016 Mon Sep 17 00:00:00 2001 From: Garux Date: Tue, 9 Apr 2024 18:57:55 +0500 Subject: [PATCH] fix TextureBrowser::clampOriginY(), min origin could be >0 fixes #186 --- radiant/texwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index dbf44f46..22d1f80a 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -272,7 +272,8 @@ public: } private: void clampOriginY(){ - m_originy = std::clamp( m_originy, m_height - totalHeight(), 0 ); + const int minOrigin = std::min( m_height - totalHeight(), 0 ); + m_originy = std::clamp( m_originy, minOrigin, 0 ); } void evaluateHeight(); int totalHeight(){