Commit d6078e17 authored by nevcairiel's avatar nevcairiel
Browse files

AceGUI-3.0: Prefer GetStringHeight over GetHeight for FontStrings, as this...

AceGUI-3.0: Prefer GetStringHeight over GetHeight for FontStrings, as this alleviates pressure on the anchor system and avoids glitches

Recommended by TheDanW to help work-around anchoring issues.

git-svn-id: https://repos.wowace.com/wow/ace3/trunk@1188 5debad98-a965-4143-8383-f471b3509dcf
parent 21960e60
--[[-----------------------------------------------------------------------------
Checkbox Widget
-------------------------------------------------------------------------------]]
local Type, Version = "CheckBox", 25
local Type, Version = "CheckBox", 26
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
......@@ -91,7 +91,7 @@ local methods = {
if self.desc then
self.desc:SetWidth(width - 30)
if self.desc:GetText() and self.desc:GetText() ~= "" then
self:SetHeight(28 + self.desc:GetHeight())
self:SetHeight(28 + self.desc:GetStringHeight())
end
end
end,
......@@ -211,7 +211,7 @@ local methods = {
self.desc:Show()
--self.text:SetFontObject(GameFontNormal)
self.desc:SetText(desc)
self:SetHeight(28 + self.desc:GetHeight())
self:SetHeight(28 + self.desc:GetStringHeight())
else
if self.desc then
self.desc:SetText("")
......
......@@ -2,7 +2,7 @@
Label Widget
Displays text and optionally an icon.
-------------------------------------------------------------------------------]]
local Type, Version = "Label", 24
local Type, Version = "Label", 25
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
......@@ -39,23 +39,23 @@ local function UpdateImageAnchor(self)
label:SetPoint("TOP", image, "BOTTOM")
label:SetPoint("LEFT")
label:SetWidth(width)
height = image:GetHeight() + label:GetHeight()
height = image:GetHeight() + label:GetStringHeight()
else
-- image on the left
image:SetPoint("TOPLEFT")
if image:GetHeight() > label:GetHeight() then
if image:GetHeight() > label:GetStringHeight() then
label:SetPoint("LEFT", image, "RIGHT", 4, 0)
else
label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0)
end
label:SetWidth(width - imagewidth - 4)
height = max(image:GetHeight(), label:GetHeight())
height = max(image:GetHeight(), label:GetStringHeight())
end
else
-- no image shown
label:SetPoint("TOPLEFT")
label:SetWidth(width)
height = label:GetHeight()
height = label:GetStringHeight()
end
self.resizing = true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment