Skip to content

Commit fb75fb5

Browse files
Fix negative delta scroll (#19573)
This fixes the sign extension from 16 to 32 bit by casting from the unsigned to the signed type first. Closes #19391 Closes #19484
1 parent 38d2fda commit fb75fb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cascadia/WindowsTerminal/IslandWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ void IslandWindow::_OnGetMinMaxInfo(const WPARAM /*wParam*/, const LPARAM lParam
624624
const auto scale = GetCurrentDpiScale();
625625
const winrt::Windows::Foundation::Point real{ relative.x / scale, relative.y / scale };
626626

627-
winrt::Microsoft::Terminal::Core::Point wheelDelta{ 0, static_cast<int32_t>(HIWORD(wparam)) };
627+
winrt::Microsoft::Terminal::Core::Point wheelDelta{ 0, std::bit_cast<int16_t>(HIWORD(wparam)) };
628628
if (message == WM_MOUSEHWHEEL)
629629
{
630630
std::swap(wheelDelta.X, wheelDelta.Y);

0 commit comments

Comments
 (0)