Skip to content

Commit 00ee14e

Browse files
committed
Fix a bug with the scrollbar (fixes #1)
1 parent c9a4a81 commit 00ee14e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

AddonProfiler.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,23 @@ function NAP:InitUI()
720720
local scrollBar = CreateFrame("EventFrame", "$parentScrollBar", display, "MinimalScrollBar")
721721
scrollBar:SetPoint("TOPLEFT", scrollBox, "TOPRIGHT", 4, -4)
722722
scrollBar:SetPoint("BOTTOMLEFT", scrollBox, "BOTTOMRIGHT", 4, 4)
723+
local thumb = scrollBar.Track.Thumb;
724+
local mouseDown = false
725+
thumb:HookScript("OnMouseDown", function(self, button)
726+
if button ~= "LeftButton" then return end
727+
mouseDown = true
728+
self:RegisterEvent("GLOBAL_MOUSE_UP")
729+
end)
730+
thumb:HookScript("OnEvent", function(self, event, ...)
731+
if event == "GLOBAL_MOUSE_UP" then
732+
local button = ...
733+
if button ~= "LeftButton" then return end
734+
if mouseDown then
735+
scrollBar.onButtonMouseUp(self, button)
736+
end
737+
mouseDown = false
738+
end
739+
end)
723740

724741
local view = CreateScrollBoxListLinearView(2, 0, 2, 2, 2)
725742
view:SetElementExtent(20)

0 commit comments

Comments
 (0)