Skip to content

Commit 8552116

Browse files
LarryThiessenclaude
andcommitted
#2013 Wheel always scrolls the block list, wherever the cursor hovers
The focused macro box used to consume the wheel and scroll its own text. That predates the auto-fit: boxes now size themselves to their content, so there is nothing left to scroll inside one -- but hovering (or typing in) a box still changed what the wheel did, which read as jumpy, inconsistent scrolling. The wheel now always drives the outer block list; ScrollFocusedMacroEditor is gone. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 89c53db commit 8552116

1 file changed

Lines changed: 5 additions & 32 deletions

File tree

GSE_GUI/Editor.lua

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -549,40 +549,13 @@ local function GetEditorScrollContainer(frame)
549549
return editor and editor.scrollContainer
550550
end
551551

552-
-- When the macro edit box has focus, wheel scrolls inside it; otherwise
553-
-- forward to the editor's outer scroll container.
554-
local function ScrollFocusedMacroEditor(macroEditBox, delta)
555-
local editBox = macroEditBox and macroEditBox.editBox
556-
if not (editBox and editBox.HasFocus and editBox:HasFocus()) then return false end
557-
558-
local scrollFrame = macroEditBox.scrollFrame
559-
if not (scrollFrame and scrollFrame.GetVerticalScroll and scrollFrame.SetVerticalScroll) then return true end
560-
561-
local range = (scrollFrame.GetVerticalScrollRange and scrollFrame:GetVerticalScrollRange()) or 0
562-
if range <= 0 then return true end
563-
564-
local current = scrollFrame:GetVerticalScroll() or 0
565-
local wheelDelta = delta or 0
566-
if wheelDelta > 0 then
567-
wheelDelta = 1
568-
elseif wheelDelta < 0 then
569-
wheelDelta = -1
570-
end
571-
local step = math.max(1, math.min(MACRO_EDITOR_SCROLL_PIXELS, range / 10))
572-
local target = current - (wheelDelta * step)
573-
if target < 0 then
574-
target = 0
575-
elseif target > range then
576-
target = range
577-
end
578-
scrollFrame:SetVerticalScroll(target)
579-
return true
580-
end
581-
582552
local function MacroEditor_OnMouseWheel(mouseFrame, delta)
553+
-- Macro boxes auto-fit their content (#1998), so there is nothing left to
554+
-- scroll INSIDE one: the wheel always drives the outer block list, making
555+
-- scrolling identical wherever the cursor hovers in the editor. (The old
556+
-- focused-box inner scroll predates the auto-fit and made wheel behaviour
557+
-- change depending on what the mouse happened to be over.)
583558
local macroEditBox = mouseFrame and mouseFrame.gseWheelForwardWidget
584-
if ScrollFocusedMacroEditor(macroEditBox, delta) then return end
585-
586559
local scrollContainer = GetEditorScrollContainer(macroEditBox and macroEditBox.gseWheelForwardFrame)
587560
if scrollContainer and scrollContainer.MoveScroll then
588561
scrollContainer:MoveScroll(delta)

0 commit comments

Comments
 (0)