mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 20:20:01 +00:00
ui-widgets: properly display statusbar zero values
Set point to zero if value and max-value are both zero. Previously, if both value and max-value were zero, it displayed the statusbar as 100% due to a division by zero.
This commit is contained in:
@@ -41,6 +41,9 @@ do -- statusbars
|
||||
point = math.min(height, point)
|
||||
point = math.max(0, point)
|
||||
|
||||
-- set point to zero if value and max is zero
|
||||
if val == 0 then point = 0 end
|
||||
|
||||
-- set status bar position/size
|
||||
self.bar:SetPoint("TOPLEFT", self, "TOPLEFT", 0, - height + point)
|
||||
self.bar:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, 0)
|
||||
@@ -57,6 +60,9 @@ do -- statusbars
|
||||
point = math.min(width, point)
|
||||
point = math.max(0, point)
|
||||
|
||||
-- set point to zero if value and max is zero
|
||||
if val == 0 then point = 0 end
|
||||
|
||||
-- set status bar position/size
|
||||
self.bar:SetPoint("TOPLEFT", self, "TOPLEFT", 0, 0)
|
||||
self.bar:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", - width + point, 0)
|
||||
|
||||
Reference in New Issue
Block a user