ui-widgets: add vanilla scaling to statusbars

This commit is contained in:
shagu
2020-03-16 16:14:45 +01:00
parent dea7e2b108
commit 4750f7f421
+4 -2
View File
@@ -26,13 +26,15 @@ do -- statusbars
if val == self.val_ then
animations[self] = nil
elseif self.mode == "vertical" then
height = self:GetHeight() / self:GetEffectiveScale()
height = self:GetHeight()
if pfUI.expansion == "vanilla" then height = height / self:GetEffectiveScale() end
point = height / (self.max - self.min) * (val - self.min)
self.bar:SetPoint("TOPLEFT", self, "TOPLEFT", 0, - height + point)
self.bg:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, point)
self.val_ = val
else
width = self:GetWidth() / self:GetEffectiveScale()
width = self:GetWidth()
if pfUI.expansion == "vanilla" then width = width / self:GetEffectiveScale() end
point = width / (self.max - self.min) * (val - self.min)
self.bar:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", - width + point, 0)
self.bg:SetPoint("TOPLEFT", self, "TOPLEFT", point, 0)