Quantcast

Fixed macclient screen bug

Steven Jackson [07-04-14 - 12:37]
Fixed macclient screen bug
Filename
Interface/AddOns/SVUI/system/screen.lua
Interface/AddOns/SVUI/system/system.lua
diff --git a/Interface/AddOns/SVUI/system/screen.lua b/Interface/AddOns/SVUI/system/screen.lua
index 5a0a14f..4dc92e2 100644
--- a/Interface/AddOns/SVUI/system/screen.lua
+++ b/Interface/AddOns/SVUI/system/screen.lua
@@ -49,9 +49,9 @@ CORE FUNCTIONS
 function SuperVillain:UIScale(event)
     self.ghettoMonitor = nil;
     if IsMacClient() and self.db.screenheight and self.db.screenwidth then
-        if self.screenheight ~= self.db.screenheight or self.screenwidth ~= self.db.screenwidth then
-            self.screenheight = self.db.screenheight;
-            self.screenwidth = self.db.screenwidth
+        if(SVUI_Cache and SVUI_Cache.screenheight and (self.screenheight ~= SVUI_Cache.screenheight or self.screenwidth ~= SVUI_Cache.screenwidth)) then
+            self.screenheight = SVUI_Cache.screenheight;
+            self.screenwidth = SVUI_Cache.screenwidth
         end
     end;

@@ -89,8 +89,8 @@ function SuperVillain:UIScale(event)

     if(event == 'PLAYER_LOGIN' or event == 'UI_SCALE_CHANGED') then
         if IsMacClient() then
-            self.db.screenheight = floor(GetScreenHeight() * 100 + .5) / 100
-            self.db.screenwidth = floor(GetScreenWidth() * 100 + .5) / 100
+            SVUI_Cache.screenheight = floor(GetScreenHeight() * 100 + .5) / 100
+            SVUI_Cache.screenwidth = floor(GetScreenWidth() * 100 + .5) / 100
         end;

         if self.evaluatedWidth then
diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua
index 216a1f7..152f100 100644
--- a/Interface/AddOns/SVUI/system/system.lua
+++ b/Interface/AddOns/SVUI/system/system.lua
@@ -379,6 +379,8 @@ local function PreLoad(self)
     if not SVUI_Cache then SVUI_Cache = {} end;
     if not SVUI_Cache["Dock"] then SVUI_Cache["Dock"] = {} end;
     if not SVUI_Cache["Mentalo"] then SVUI_Cache["Mentalo"] = {} end;
+    if not SVUI_Cache["screenheight"] then SVUI_Cache["screenheight"] = {} end;
+    if not SVUI_Cache["screenwidth"] then SVUI_Cache["screenwidth"] = {} end;

     --[[ MORE DEPRECATED ]]--
     if SVUI_Cache["Mentalo"]["Blizzard"] then SVUI_Cache["Mentalo"]["Blizzard"] = nil end;