Skip to content

Commit

Permalink
apply 30365b to old dynamic group
Browse files Browse the repository at this point in the history
  • Loading branch information
emptyrivers committed Jun 6, 2021
1 parent c271229 commit 9bb9b39
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions WeakAuras/RegionTypes/DynamicGroupOld.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ local function create(parent)
region.controlPoints.parent = region
WeakAuras.regionPrototype.create(region)
region.suspended = 0

local oldSetFrameLevel = region.SetFrameLevel
region.SetFrameLevel = function(self, level)
oldSetFrameLevel(self, level)
self.border:SetFrameLevel(level)
end

return region
end

Expand Down Expand Up @@ -1205,22 +1212,20 @@ local function modify(parent, region, data)
-- if self.dynamicAnchor then self:UpdateBorder(); return end
Private.StartProfileSystem("dynamicgroup")
Private.StartProfileAura(data.id)
local numVisible, minX, maxX, maxY, minY, minLevel = 0
local numVisible, minX, maxX, maxY, minY = 0
for active, regionData in ipairs(self.sortedChildren) do
if regionData.shown then
numVisible = numVisible + 1
local childRegion = regionData.region
local regionLeft, regionRight, regionTop, regionBottom
= SafeGetPos(childRegion, childRegion.GetLeft), SafeGetPos(childRegion, childRegion.GetRight),
SafeGetPos(childRegion, childRegion.GetTop), SafeGetPos(childRegion, childRegion.GetBottom)
local frameLevel = childRegion:GetFrameLevel()

if(regionLeft and regionRight and regionTop and regionBottom and frameLevel) then
if(regionLeft and regionRight and regionTop and regionBottom) then
minX = minX and min(regionLeft, minX) or regionLeft
maxX = maxX and max(regionRight, maxX) or regionRight
minY = minY and min(regionBottom, minY) or regionBottom
maxY = maxY and max(regionTop, maxY) or regionTop
minLevel = minLevel and min(frameLevel, minLevel) or frameLevel
end
end
end
Expand All @@ -1237,7 +1242,6 @@ local function modify(parent, region, data)
self:SetHeight(height)
self.currentWidth = width
self.currentHeight = height
self.background:SetFrameLevel(minLevel and minLevel - 1 or 0)
else
self:Hide()
end
Expand Down

0 comments on commit 9bb9b39

Please sign in to comment.