mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update pixelperfect
This commit is contained in:
@@ -26,7 +26,6 @@ local RAID_CLASS_COLORS = RAID_CLASS_COLORS
|
|||||||
E.LSM = LSM
|
E.LSM = LSM
|
||||||
E.noop = function() end
|
E.noop = function() end
|
||||||
E.title = format("|cff175581E|r|cffC4C4C4lvUI|r")
|
E.title = format("|cff175581E|r|cffC4C4C4lvUI|r")
|
||||||
E.myfaction, E.myLocalizedFaction = UnitFactionGroup("player")
|
|
||||||
E.myLocalizedClass, E.myclass = UnitClass("player")
|
E.myLocalizedClass, E.myclass = UnitClass("player")
|
||||||
E.myLocalizedRace, E.myrace = UnitRace("player")
|
E.myLocalizedRace, E.myrace = UnitRace("player")
|
||||||
E.myname = UnitName("player")
|
E.myname = UnitName("player")
|
||||||
|
|||||||
@@ -7,8 +7,12 @@ local match = string.match
|
|||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local GetCVar, SetCVar = GetCVar, SetCVar
|
local GetCVar, SetCVar = GetCVar, SetCVar
|
||||||
|
|
||||||
local scale
|
--Global variables that we don"t cache, list them here for the mikk"s Find Globals script
|
||||||
|
-- GLOBALS: UIParent, WorldMapFrame
|
||||||
|
|
||||||
|
--Determine if Eyefinity is being used, setup the pixel perfect script.
|
||||||
|
|
||||||
|
local scale
|
||||||
function E:UIScale(event)
|
function E:UIScale(event)
|
||||||
local width = E.screenwidth
|
local width = E.screenwidth
|
||||||
local height = E.screenheight
|
local height = E.screenheight
|
||||||
@@ -55,8 +59,8 @@ function E:UIScale(event)
|
|||||||
end
|
end
|
||||||
|
|
||||||
E.mult = 768/height/scale
|
E.mult = 768/height/scale
|
||||||
E.Spacing = E.PixelMode and 0 or E.mult
|
E.Spacing = (E.PixelMode and 0) or E.mult
|
||||||
E.Border = (E.PixelMode and E.mult or E.mult*2)
|
E.Border = (E.PixelMode and E.mult) or E.mult*2
|
||||||
|
|
||||||
if E.global.general.autoScale then
|
if E.global.general.autoScale then
|
||||||
--Set UIScale, NOTE: SetCVar for UIScale can cause taints so only do this when we need to..
|
--Set UIScale, NOTE: SetCVar for UIScale can cause taints so only do this when we need to..
|
||||||
@@ -77,8 +81,8 @@ function E:UIScale(event)
|
|||||||
-- if autoscale is off, find a new width value of E.UIParent for screen #1.
|
-- if autoscale is off, find a new width value of E.UIParent for screen #1.
|
||||||
if not E.global.general.autoScale or height > 1200 then
|
if not E.global.general.autoScale or height > 1200 then
|
||||||
local h = UIParent:GetHeight()
|
local h = UIParent:GetHeight()
|
||||||
local ratio = height / h
|
local ratio = (height / h)
|
||||||
local w = width / ratio
|
local w = (width / ratio)
|
||||||
|
|
||||||
width = w
|
width = w
|
||||||
height = h
|
height = h
|
||||||
@@ -88,8 +92,7 @@ function E:UIScale(event)
|
|||||||
Dragging moveable frames outside the box and reloading the UI ensures that they are saving position correctly.
|
Dragging moveable frames outside the box and reloading the UI ensures that they are saving position correctly.
|
||||||
]]
|
]]
|
||||||
else
|
else
|
||||||
width = UIParent:GetWidth()
|
width, height = UIParent:GetWidth(), UIParent:GetHeight()
|
||||||
height = UIParent:GetHeight()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
E.UIParent:SetWidth(width)
|
E.UIParent:SetWidth(width)
|
||||||
@@ -97,6 +100,7 @@ function E:UIScale(event)
|
|||||||
E.UIParent:ClearAllPoints()
|
E.UIParent:ClearAllPoints()
|
||||||
E.UIParent:SetAllPoints(UIParent)
|
E.UIParent:SetAllPoints(UIParent)
|
||||||
|
|
||||||
|
--Calculate potential coordinate differences
|
||||||
E.diffGetLeft = E:Round(abs(UIParent:GetLeft() - E.UIParent:GetLeft()))
|
E.diffGetLeft = E:Round(abs(UIParent:GetLeft() - E.UIParent:GetLeft()))
|
||||||
E.diffGetRight = E:Round(abs(UIParent:GetRight() - E.UIParent:GetRight()))
|
E.diffGetRight = E:Round(abs(UIParent:GetRight() - E.UIParent:GetRight()))
|
||||||
E.diffGetTop = E:Round(abs(UIParent:GetTop() - E.UIParent:GetTop()))
|
E.diffGetTop = E:Round(abs(UIParent:GetTop() - E.UIParent:GetTop()))
|
||||||
|
|||||||
Reference in New Issue
Block a user