Progress bar size using width set in display instead of real width
Vardex opened this issue ยท 2 comments
Describe the bug
I have a progress bar on top of a dynamic group, I anchored it with SetPoint to that group.
Since 2.12.4.2 it stopped working like it was supposed to, the max value for the progress bar is now the width of it instead of the size of it.
Do you have an error log of what happened?
No error.
To Reproduce
- Create a dynamic group
- Set it to centered horizontal
- Put icon aura in it
- Create a progress bar to whatever you like (like health)
- Anchor it with the following code on init:
local group = WeakAuras.regions["TestDynamicGroup"].region
aura_env.region:ClearAllPoints()
aura_env.region:SetPoint("TOPLEFT", group, "TOPLEFT", -1, 18)
aura_env.region:SetPoint("TOPRIGHT", group, "TOPRIGHT", 1, 18)
--TestDynamicGroup is the name of the dynamic group
Screenshots
The red bar should be full but it's not, it instead it's 200 pixel long which is the width of the progress bar.
Did you try having WeakAuras as the only enabled addon and everything else (especially something like ElvUI) disabled?
No.
Which version of WeakAuras are you using?
2.12.4.2.
Was it working in a previous version? If yes, which was the last good one?
It was working in 2.12.4.1.
Additional context
I guess that bug was cause by commit 92fe62d.
Some test auras to quickly test the problem:
TestDynamicGroup: https://wago.io/F5vUggPLY
TestProgressBar: https://wago.io/jnbDEoA6X
Well, that's unsupported, so you need to figure out how to tell the progress bar it's real size.
Here what I did to fix this, on init:
local group = WeakAuras.regions["TestDynamicGroup"].region
local region = aura_env.region
local function UpdateBar()
if region and region.bar then
region.bar.totalWidth = group:GetWidth() + 1
region.bar:UpdateProgress()
end
end
region:ClearAllPoints()
region:SetPoint("TOPLEFT", group, "TOPLEFT", -1, 18)
region:SetPoint("TOPRIGHT", group, "TOPRIGHT", 1, 18)
hooksecurefunc(group, "Resize", UpdateBar)
--TestDynamicGroup is the name of the dynamic group