Try to preserve the old position properly during the migration to the new system.

This commit is contained in:
Hendrik Leppkes
2009-02-21 14:14:53 +01:00
parent 6f5086adc8
commit e9071dc3d0
3 changed files with 16 additions and 2 deletions
+14
View File
@@ -220,6 +220,10 @@ function Bar:UpgradeConfig()
pos.relPoint = nil
end
end
if version < 3 then
-- Size adjustment is done in first SetSize
self.needSizeFix = true
end
self.config.version = Bartender4.CONFIG_VERSION
end
@@ -256,6 +260,16 @@ end
function Bar:SetSize(width, height)
self.overlay:SetWidth(width)
self.overlay:SetHeight(height or width)
if self.needSizeFix then
self:SetWidth(width)
self:SetHeight(height or width)
local x, y = self:GetLeft(), self:GetTop()
self:ClearSetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", x, y)
self:SetWidth(1)
self:SetHeight(1)
self:SavePosition()
self.needSizeFix = nil
end
end
function Bar:GetConfigAlpha()