mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 16:34:45 +00:00
temp fix AceGUIContainer-ScrollFrame
This commit is contained in:
@@ -93,37 +93,42 @@ local methods = {
|
|||||||
if self.updateLock then return end
|
if self.updateLock then return end
|
||||||
self.updateLock = true
|
self.updateLock = true
|
||||||
local status = self.status or self.localstatus
|
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 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
|
-- 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!
|
-- 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
|
if self.scrollBarShown then
|
||||||
self.scrollBarShown = nil
|
self.scrollBarShown = nil
|
||||||
self.scrollbar:Hide()
|
scrollbar:Hide()
|
||||||
self.scrollbar:SetValue(0)
|
scrollbar:SetValue(0)
|
||||||
self.scrollframe:SetPoint("BOTTOMRIGHT", 0, 0)
|
scrollframe:SetPoint("BOTTOMRIGHT",0,0)
|
||||||
self:DoLayout()
|
self:DoLayout()
|
||||||
end
|
end
|
||||||
|
offset = 0
|
||||||
else
|
else
|
||||||
if not self.scrollBarShown then
|
if not self.scrollBarShown then
|
||||||
self.scrollBarShown = true
|
self.scrollBarShown = true
|
||||||
self.scrollbar:Show()
|
scrollbar:Show()
|
||||||
self.scrollframe:SetPoint("BOTTOMRIGHT", -20, 0)
|
scrollframe:SetPoint("BOTTOMRIGHT", -20, 0)
|
||||||
self:DoLayout()
|
self:DoLayout()
|
||||||
end
|
end
|
||||||
local value = (offset / (viewheight - height) * 1000)
|
local value = (offset / (height - viewheight) * 1000)
|
||||||
if value > 1000 then value = 1000 end
|
if value > 1000 then
|
||||||
self.scrollbar:SetValue(value)
|
value = 1000
|
||||||
|
offset = height - viewheight
|
||||||
|
end
|
||||||
|
scrollbar:SetValue(value)
|
||||||
self:SetScroll(value)
|
self:SetScroll(value)
|
||||||
if value < 1000 then
|
end
|
||||||
self.content:ClearAllPoints()
|
|
||||||
self.content:SetPoint("TOPLEFT", 0, offset)
|
|
||||||
self.content:SetPoint("TOPRIGHT", 0, offset)
|
|
||||||
status.offset = offset
|
status.offset = offset
|
||||||
end
|
scrollframe:SetScrollChild(content)
|
||||||
end
|
content:ClearAllPoints()
|
||||||
|
content:SetPoint("TOPLEFT", 0, offset)
|
||||||
|
content:SetPoint("TOPRIGHT", 0, offset)
|
||||||
self.updateLock = nil
|
self.updateLock = nil
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user