mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
temp fix AceGUIContainer-ScrollFrame
This commit is contained in:
@@ -93,37 +93,42 @@ local methods = {
|
||||
if self.updateLock then return end
|
||||
self.updateLock = true
|
||||
local status = self.status or self.localstatus
|
||||
local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
|
||||
local scrollframe, content, scrollbar = self.scrollframe, self.content, self.scrollbar
|
||||
local viewheight, height = self.scrollframe:GetHeight(), self.content:GetHeight()
|
||||
local offset = status.offset or 0
|
||||
local curvalue = self.scrollbar:GetValue()
|
||||
local curvalue = scrollbar:GetValue()
|
||||
-- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracys
|
||||
-- No-one is going to miss 2 pixels at the bottom of the frame, anyhow!
|
||||
if viewheight < height + 2 then
|
||||
|
||||
if height < viewheight + 2 then
|
||||
if self.scrollBarShown then
|
||||
self.scrollBarShown = nil
|
||||
self.scrollbar:Hide()
|
||||
self.scrollbar:SetValue(0)
|
||||
self.scrollframe:SetPoint("BOTTOMRIGHT", 0, 0)
|
||||
scrollbar:Hide()
|
||||
scrollbar:SetValue(0)
|
||||
scrollframe:SetPoint("BOTTOMRIGHT",0,0)
|
||||
self:DoLayout()
|
||||
end
|
||||
offset = 0
|
||||
else
|
||||
if not self.scrollBarShown then
|
||||
self.scrollBarShown = true
|
||||
self.scrollbar:Show()
|
||||
self.scrollframe:SetPoint("BOTTOMRIGHT", -20, 0)
|
||||
scrollbar:Show()
|
||||
scrollframe:SetPoint("BOTTOMRIGHT", -20, 0)
|
||||
self:DoLayout()
|
||||
end
|
||||
local value = (offset / (viewheight - height) * 1000)
|
||||
if value > 1000 then value = 1000 end
|
||||
self.scrollbar:SetValue(value)
|
||||
local value = (offset / (height - viewheight) * 1000)
|
||||
if value > 1000 then
|
||||
value = 1000
|
||||
offset = height - viewheight
|
||||
end
|
||||
scrollbar:SetValue(value)
|
||||
self:SetScroll(value)
|
||||
if value < 1000 then
|
||||
self.content:ClearAllPoints()
|
||||
self.content:SetPoint("TOPLEFT", 0, offset)
|
||||
self.content:SetPoint("TOPRIGHT", 0, offset)
|
||||
end
|
||||
status.offset = offset
|
||||
end
|
||||
end
|
||||
scrollframe:SetScrollChild(content)
|
||||
content:ClearAllPoints()
|
||||
content:SetPoint("TOPLEFT", 0, offset)
|
||||
content:SetPoint("TOPRIGHT", 0, offset)
|
||||
self.updateLock = nil
|
||||
end,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user