from retail
This commit is contained in:
@@ -99,22 +99,28 @@ local function modify(parent, region, data)
|
||||
-- Scale
|
||||
region:SetScale(data.scale and data.scale > 0 and data.scale <= 10 and data.scale or 1)
|
||||
|
||||
-- Get overall bounding box
|
||||
local leftest, rightest, lowest, highest = 0, 0, 0, 0;
|
||||
for child in Private.TraverseLeafs(data) do
|
||||
local childRegion = WeakAuras.GetRegion(child.id)
|
||||
if(child) then
|
||||
local blx, bly, trx, try = getRect(child, childRegion);
|
||||
leftest = math.min(leftest, blx);
|
||||
rightest = math.max(rightest, trx);
|
||||
lowest = math.min(lowest, bly);
|
||||
highest = math.max(highest, try);
|
||||
region.GetBoundingRect = function(self)
|
||||
if not self.boundingRect then
|
||||
local leftest, rightest, lowest, highest = 0, 0, 0, 0;
|
||||
for child in Private.TraverseLeafs(data) do
|
||||
local childRegion = WeakAuras.GetRegion(child.id)
|
||||
if(child) then
|
||||
local blx, bly, trx, try = getRect(child, childRegion);
|
||||
leftest = math.min(leftest, blx);
|
||||
rightest = math.max(rightest, trx);
|
||||
lowest = math.min(lowest, bly);
|
||||
highest = math.max(highest, try);
|
||||
end
|
||||
end
|
||||
self.blx = leftest
|
||||
self.bly = lowest
|
||||
self.trx = rightest
|
||||
self.try = highest
|
||||
self.boundingRect = true
|
||||
end
|
||||
return self.blx, self.bly, self.trx, self.try
|
||||
end
|
||||
region.blx = leftest;
|
||||
region.bly = lowest;
|
||||
region.trx = rightest;
|
||||
region.try = highest;
|
||||
region.boundingRect = false
|
||||
|
||||
-- Adjust frame-level sorting
|
||||
Private.FixGroupChildrenOrderForGroup(data);
|
||||
@@ -150,6 +156,8 @@ local function modify(parent, region, data)
|
||||
|
||||
-- Show border if child is visible
|
||||
if childVisible then
|
||||
local blx, bly, trx, try = self:GetBoundingRect()
|
||||
|
||||
border:SetBackdrop({
|
||||
edgeFile = data.borderEdge ~= "None" and SharedMedia:Fetch("border", data.borderEdge) or "",
|
||||
edgeSize = data.borderSize,
|
||||
@@ -165,8 +173,8 @@ local function modify(parent, region, data)
|
||||
border:SetBackdropColor(data.backdropColor[1], data.backdropColor[2], data.backdropColor[3], data.backdropColor[4]);
|
||||
|
||||
border:ClearAllPoints();
|
||||
border:SetPoint("bottomleft", region, "bottomleft", leftest-data.borderOffset, lowest-data.borderOffset);
|
||||
border:SetPoint("topright", region, "topright", rightest+data.borderOffset, highest+data.borderOffset);
|
||||
border:SetPoint("bottomleft", region, "bottomleft", blx - data.borderOffset, bly - data.borderOffset);
|
||||
border:SetPoint("topright", region, "topright", trx + data.borderOffset, try + data.borderOffset);
|
||||
border:Show();
|
||||
else
|
||||
border:Hide();
|
||||
|
||||
@@ -33,6 +33,8 @@ local default = {
|
||||
borderBackdrop = "Blizzard Tooltip"
|
||||
};
|
||||
|
||||
Private.regionPrototype.AddAlphaToDefault(default)
|
||||
|
||||
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
||||
|
||||
local properties = {
|
||||
@@ -63,7 +65,13 @@ local function GetProperties(data)
|
||||
end
|
||||
|
||||
local regionFunctions = {
|
||||
Update = function() end
|
||||
Update = function() end,
|
||||
SetAlpha = function(self, alpha)
|
||||
self.alpha = alpha
|
||||
if self.model then
|
||||
self.model:SetAlpha(alpha)
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
-- Called when first creating a new region/display
|
||||
@@ -161,6 +169,7 @@ local function AcquireModel(region, data)
|
||||
end
|
||||
|
||||
local function ReleaseModel(model)
|
||||
model:SetAlpha(1)
|
||||
--model:SetKeepModelOnHide(false)
|
||||
model:Hide()
|
||||
model:UnregisterEvent("UNIT_MODEL_CHANGED");
|
||||
@@ -272,6 +281,9 @@ local function modify(parent, region, data)
|
||||
else
|
||||
ConfigureModel(region, region.model, data)
|
||||
end
|
||||
if type(data.alpha) == "number" then
|
||||
region:SetAlpha(data.alpha)
|
||||
end
|
||||
end
|
||||
|
||||
function region:PreHide()
|
||||
|
||||
Reference in New Issue
Block a user