Commit e116ab63 authored by Blazeflack's avatar Blazeflack

Fixed issue with castbar size not updating correctly when changing unitframe size.

parent c1ca7a9a
...@@ -3,9 +3,12 @@ local CBO = E:GetModule('CastBarOverlay') ...@@ -3,9 +3,12 @@ local CBO = E:GetModule('CastBarOverlay')
local UF = E:GetModule('UnitFrames'); local UF = E:GetModule('UnitFrames');
local EP = LibStub('LibElvUIPlugin-1.0') local EP = LibStub('LibElvUIPlugin-1.0')
local addon, ns = ... local addon, ns = ...
local CBS_Enabled = false local CBS_Enabled = false
--Cache global variables
local _G = _G
local C_Timer_After = C_Timer.After
-- Create compatibility warning popup -- Create compatibility warning popup
E.PopupDialogs['CBOCompatibility'] = { E.PopupDialogs['CBOCompatibility'] = {
text = L['CBO_CONFLICT_WARNING'], text = L['CBO_CONFLICT_WARNING'],
...@@ -38,6 +41,7 @@ local function SetCastbarSizeAndPosition(unit, unitframe, overlayFrame) ...@@ -38,6 +41,7 @@ local function SetCastbarSizeAndPosition(unit, unitframe, overlayFrame)
castbar.origFrameStrata = castbar.origFrameStrata or castbar:GetFrameStrata() castbar.origFrameStrata = castbar.origFrameStrata or castbar:GetFrameStrata()
castbar.origFrameLevel = castbar.origFrameLevel or castbar:GetFrameLevel() castbar.origFrameLevel = castbar.origFrameLevel or castbar:GetFrameLevel()
-- if unit == "player" then print(overlayFrame.backdrop:GetWidth()) end
local overlayWidth = overlayFrame.backdrop and (overlayFrame.backdrop:GetWidth() + (E.Spacing * 2)) or overlayFrame:GetWidth() local overlayWidth = overlayFrame.backdrop and (overlayFrame.backdrop:GetWidth() + (E.Spacing * 2)) or overlayFrame:GetWidth()
local overlayHeight = overlayFrame.backdrop and (overlayFrame.backdrop:GetHeight() + (E.Spacing * 2)) or overlayFrame:GetHeight() local overlayHeight = overlayFrame.backdrop and (overlayFrame.backdrop:GetHeight() + (E.Spacing * 2)) or overlayFrame:GetHeight()
...@@ -132,7 +136,7 @@ local function ConfigureCastbar(unit, unitframe) ...@@ -132,7 +136,7 @@ local function ConfigureCastbar(unit, unitframe)
if db.overlay then if db.overlay then
local OverlayFrame = db.overlayOnFrame == "HEALTH" and unitframe.Health or unitframe.Power local OverlayFrame = db.overlayOnFrame == "HEALTH" and unitframe.Health or unitframe.Power
SetCastbarSizeAndPosition(unit, unitframe, OverlayFrame) C_Timer_After(0.01, function() SetCastbarSizeAndPosition(unit, unitframe, OverlayFrame) end) --Delay it a bit, so size of overlayFrame is updated before we grab it.
ConfigureText(unit, castbar) ConfigureText(unit, castbar)
elseif castbar.isOverlayed then elseif castbar.isOverlayed then
ResetCastbarSizeAndPosition(unit, unitframe) ResetCastbarSizeAndPosition(unit, unitframe)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment