Untitled diff
22 lines
local function UpdateFrameSize(f)
local function UpdateFrameSize(f)
-- set frame size and position
-- set frame size and position
if f.state.minus then
if f.state.player then
f.bg:SetSize(500,100)
elseif f.state.minus then
f.bg:SetSize(FRAME_WIDTH_MINUS,FRAME_HEIGHT_MINUS)
f.bg:SetSize(FRAME_WIDTH_MINUS,FRAME_HEIGHT_MINUS)
else
else
f.bg:SetSize(FRAME_WIDTH,FRAME_HEIGHT)
f.bg:SetSize(FRAME_WIDTH,FRAME_HEIGHT)
end
end
if f.state.no_name and not f.state.player then
if f.state.no_name and not f.state.player then
f.bg:SetHeight(FRAME_HEIGHT_MINUS)
f.bg:SetHeight(FRAME_HEIGHT_MINUS)
end
end
-- calculate point to remain pixel-perfect
-- calculate point to remain pixel-perfect
f.x = floor((addon.width / 2) - (f.bg:GetWidth() / 2))
f.x = floor((addon.width / 2) - (f.bg:GetWidth() / 2))
f.y = floor((addon.height / 2) - (f.bg:GetHeight() / 2))
f.y = floor((addon.height / 2) - (f.bg:GetHeight() / 2))
f.bg:SetPoint('BOTTOMLEFT',f.x,f.y)
f.bg:SetPoint('BOTTOMLEFT',f.x,f.y)
f:UpdateMainBars()
f:UpdateMainBars()
f:SpellIconSetWidth()
f:SpellIconSetWidth()
f:UpdateAuras()
f:UpdateAuras()
end
end