diff --git a/modules/afkcam.lua b/modules/afkcam.lua index ab554962..72b1b6be 100644 --- a/modules/afkcam.lua +++ b/modules/afkcam.lua @@ -74,11 +74,7 @@ pfUI:RegisterModule("afkcam", function () chat:RegisterEvent(ctype) end chat:SetScript("OnMouseWheel",function() - if arg1 > 0 then - this:ScrollUp() - else - this:ScrollDown() - end + this:ScrollByAmount(arg1) end) overlay.chat = chat diff --git a/modules/chat.lua b/modules/chat.lua index db3fa1c5..af8f3fe4 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -278,22 +278,14 @@ pfUI:RegisterModule("chat", function () pfUI.chat:RegisterEvent("UI_SCALE_CHANGED") local function ChatOnMouseWheel() - if (arg1 > 0) then - if IsShiftKeyDown() then - this:ScrollToTop() - else - for i=1, C.chat.global.scrollspeed do - this:ScrollUp() - end - end - elseif (arg1 < 0) then - if IsShiftKeyDown() then - this:ScrollToBottom() - else - for i=1, C.chat.global.scrollspeed do - this:ScrollDown() - end - end + if not IsShiftKeyDown() then + this:ScrollByAmount(arg1 * C.chat.global.scrollspeed) + elseif arg1 > 0 then + -- stops with the oldest line on top, as the wheel does; ScrollToTop + -- would leave it alone on the bottom line + this:ScrollByAmount(this:GetMaxScrollRange()) + else + this:ScrollToBottom() end end