From c260d4033e49d0931275c94a0a47ba8a003556f1 Mon Sep 17 00:00:00 2001 From: NoM0Re <1629787+NoM0Re@users.noreply.github.com> Date: Sat, 25 Oct 2025 02:36:23 +0200 Subject: [PATCH] (fix/DynamicGroup): delay Resize to next frame to fix child positioning (cherry picked from commit 01121291e8a486bd74568e71e4aebe8442e54de4) --- WeakAuras/RegionTypes/DynamicGroup.lua | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/WeakAuras/RegionTypes/DynamicGroup.lua b/WeakAuras/RegionTypes/DynamicGroup.lua index 831e194..71374bb 100644 --- a/WeakAuras/RegionTypes/DynamicGroup.lua +++ b/WeakAuras/RegionTypes/DynamicGroup.lua @@ -1049,6 +1049,28 @@ local function clearCache(cache, id, cloneId) end end +-- Resize queue +local RunNextFrame = CreateFrame("Frame") +local q = {} +RunNextFrame:Hide() + +function QueueResize(g) + if not g then return end + q[#q+1] = g + RunNextFrame:Show() +end + +RunNextFrame:SetScript("OnUpdate", function(self) + self:Hide() + for i = 1, #q do + local g = q[i] + q[i] = nil + if g and g.Resize then + g:Resize() + end + end +end) + local function modify(parent, region, data) Private.FixGroupChildrenOrderForGroup(data) region:SetScale(data.scale and data.scale > 0 and data.scale <= 10 and data.scale or 1) @@ -1528,7 +1550,7 @@ local function modify(parent, region, data) Private.StopProfileSystem("dynamicgroup") Private.StopProfileAura(data.id) - self:Resize() + QueueResize(self) end