Try:
Code:
local function FocusCastbarReposition()
local focusRight = FocusFramePortrait:GetRight() * FocusFrame:GetEffectiveScale() / FocusFrameSpellBar:GetEffectiveScale()
local castRight = FocusFrameSpellBar:GetRight()
local point, relFrame, relPoint, xOffset, yOffset = FocusFrameSpellBar:GetPoint()
FocusFrameSpellBar:ClearAllPoints()
FocusFrameSpellBar:SetPoint(point, relFrame, relPoint, xOffset + focusRight - castRight, yOffset)
Addon:SetScript("OnUpdate", nil)
end
-- Changing the X-offset of FocusFrame's castbar in the
-- next frame (when the anchor values will be updated)
hooksecurefunc(FocusFrameSpellBar, "SetPoint", function()
Addon:SetScript("OnUpdate", FocusCastbarReposition)
end)