From 63aa6e782505abc3a1facf8abccb1d628ce5ce2a Mon Sep 17 00:00:00 2001 From: Porkchop Date: Sat, 4 May 2019 02:04:06 -0600 Subject: [PATCH] Lobby - Bugfix for High CPU at non-100% scale Improve performance by comparing x,y against unscaled values and passing scaled dimensions to screen. --- LuaMenu/widgets/api_chili.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LuaMenu/widgets/api_chili.lua b/LuaMenu/widgets/api_chili.lua index 8c3f9bb98..d1979810f 100644 --- a/LuaMenu/widgets/api_chili.lua +++ b/LuaMenu/widgets/api_chili.lua @@ -264,9 +264,11 @@ function widget:ViewResize(vsx, vsy) if totalHideInterface then return end - vsx, vsy = vsx/(WG.uiScale or 1), vsy/(WG.uiScale or 1) - oldSizeX, oldSizeY = vsx, vsy - screen0:Resize(vsx, vsy) + local ssx, ssy = vsx/(WG.uiScale or 1), vsy/(WG.uiScale or 1) + if oldSizeX ~= vsx or oldSizeY ~= vsy then + oldSizeX, oldSizeY = vsx, vsy + screen0:Resize(ssx, ssy) + end end function widget:Update()