Quantcast
WoWInterface - View Single Post - GetRight() positioning problem
View Single Post
12-20-13, 12:56 AM   #4
Vrul
An Onyxian Warder
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 353
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)
  Reply With Quote