From dbdefd074b517b108cd82ff9f3114c9270d581d5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 9 Jul 2014 16:17:13 -0400 Subject: [PATCH] DolphinWX: Remove yet another clamp method --- Source/Core/DolphinWX/FrameAui.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Source/Core/DolphinWX/FrameAui.cpp b/Source/Core/DolphinWX/FrameAui.cpp index 283bead945..34b0a72b28 100644 --- a/Source/Core/DolphinWX/FrameAui.cpp +++ b/Source/Core/DolphinWX/FrameAui.cpp @@ -33,6 +33,7 @@ #include "Common/Common.h" #include "Common/FileUtil.h" #include "Common/IniFile.h" +#include "Common/MathUtil.h" #include "Common/StringUtil.h" #include "Common/Logging/ConsoleListener.h" #include "Core/ConfigManager.h" @@ -733,13 +734,6 @@ void CFrame::OnSelectPerspective(wxCommandEvent& event) DoLoadPerspective(); } -static int Limit(int i, int Low, int High) -{ - if (i < Low) return Low; - if (i > High) return High; - return i; -} - void CFrame::SetPaneSize() { if (Perspectives.size() <= ActivePerspective) @@ -764,8 +758,8 @@ void CFrame::SetPaneSize() H = Perspectives[ActivePerspective].Height[j]; // Check limits - W = Limit(W, 5, 95); - H = Limit(H, 5, 95); + MathUtil::Clamp(&W, 5, 95); + MathUtil::Clamp(&H, 5, 95); // Convert percentages to pixel lengths W = (W * iClientX) / 100;