From a52857e95bfc77bb6e139cbf1b92892d70a57536 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Mon, 31 Oct 2022 09:32:48 +0800 Subject: [PATCH] FIX: mouse wheel direction Change-Id: I7b9a5e300de8e7f0c5a9883a20a18856f79c2b93 --- src/slic3r/GUI/ImageGrid.cpp | 2 +- src/slic3r/GUI/Widgets/ComboBox.cpp | 2 +- src/slic3r/GUI/Widgets/SpinInput.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/ImageGrid.cpp b/src/slic3r/GUI/ImageGrid.cpp index 67f436229d..7812ed6b13 100644 --- a/src/slic3r/GUI/ImageGrid.cpp +++ b/src/slic3r/GUI/ImageGrid.cpp @@ -370,7 +370,7 @@ void ImageGrid::resize(wxSizeEvent& event) void ImageGrid::mouseWheelMoved(wxMouseEvent &event) { - auto delta = (event.GetWheelRotation() < 0 == event.IsWheelInverted()) ? -1 : 1; + auto delta = event.GetWheelRotation() < 0 ? 1 : -1; int off = m_row_offset + delta; if (off >= 0 && off < m_row_count) { m_row_offset = off; diff --git a/src/slic3r/GUI/Widgets/ComboBox.cpp b/src/slic3r/GUI/Widgets/ComboBox.cpp index 01d7d9614c..0b36f85e70 100644 --- a/src/slic3r/GUI/Widgets/ComboBox.cpp +++ b/src/slic3r/GUI/Widgets/ComboBox.cpp @@ -222,7 +222,7 @@ void ComboBox::mouseWheelMoved(wxMouseEvent &event) { event.Skip(); if (drop_down) return; - auto delta = (event.GetWheelRotation() < 0 == event.IsWheelInverted()) ? -1 : 1; + auto delta = event.GetWheelRotation() < 0 ? 1 : -1; unsigned int n = GetSelection() + delta; if (n < GetCount()) { SetSelection((int) n); diff --git a/src/slic3r/GUI/Widgets/SpinInput.cpp b/src/slic3r/GUI/Widgets/SpinInput.cpp index 9bea97dcdc..d4b03795bc 100644 --- a/src/slic3r/GUI/Widgets/SpinInput.cpp +++ b/src/slic3r/GUI/Widgets/SpinInput.cpp @@ -288,7 +288,7 @@ void SpinInput::onTextEnter(wxCommandEvent &event) void SpinInput::mouseWheelMoved(wxMouseEvent &event) { - auto delta = (event.GetWheelRotation() < 0 == event.IsWheelInverted()) ? 1 : -1; + auto delta = event.GetWheelRotation() < 0 ? 1 : -1; SetValue(val + delta); sendSpinEvent(); text_ctrl->SetFocus();