WeakAuras

WeakAuras

206M Downloads

X/Y offset for custom grow dynamic groups is wrong

sragia opened this issue ยท 1 comments

commented

Describe the bug
The further dynamic group is from 0, 0 coordinates the further x/y offset is being applied to auras in group. Not noticing this on "default" grow options (havent tested all of them however)
Not sure how to exactly explain this, but here's streamable with me showing what is happening.
https://streamable.com/30u0y
In VDT I am showing newPosition table that is generated in my custom grow function. Mover frame is completely not corresponding to where actual auras are. Moving them closer to 0,0 reduces the gap.
In VDT you can see that I should have an aura that is on 0,0 (largest one).

Do you have an error log of what happened?
No errors. Only have missing LibGetFrame lib atm as curse is being ...... and not allowing directly download alphas for some reason. Doubt that this could be an issue.

To Reproduce
Import this weakaura https://wago.io/Igvl6x_l6
Should be able to see the same issue.

Did you try having WeakAuras as the only enabled addon and everything else (especially something like ElvUI) disabled?
Yes, same issue

Which version of WeakAuras are you using?
I am on 957325a

Was it working in a previous version? If yes, which was the last good one?
Yes, worked without any issue before

With my detective work of (git reset --hard until it works) 933d630 seems to be the cause. After this commit I see this happening

commented

Custom grow function has changed a bit and is not backward compatible.
"pos" array is keyed by anchor frame, or "" if it's anchored to the group, and then an other array index by regionData

Here is a fix:

    pos[""] = {}
    for position, data in pairs(items) do
        local regions = data.items
        local notFirst = false
        if data.hasItems then
            local prevY = 0
            for _, r in ipairs(regions) do
                if notFirst then
                    data.currY = data.currY + posGrow[position] * (margin + prevY + r.item.region.height / 2)
                end
                
                prevY = r.item.region.height / 2
                pos[""][r.item] = { data.currX, data.currY }
                notFirst = true
            end
        end
    end