From 21b69c2989566153f15441edea499acd3234dc88 Mon Sep 17 00:00:00 2001 From: EdnY1 Date: Sat, 21 Sep 2024 01:35:39 -0400 Subject: [PATCH] Requested changes --- src/details/QCefViewPrivate.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/details/QCefViewPrivate.cpp b/src/details/QCefViewPrivate.cpp index 9cda2b4..6318dff 100644 --- a/src/details/QCefViewPrivate.cpp +++ b/src/details/QCefViewPrivate.cpp @@ -1036,6 +1036,7 @@ QCefViewPrivate::onViewWheelEvent(QWheelEvent* event) e.modifiers |= m & Qt::ControlModifier ? EVENTFLAG_CONTROL_DOWN : 0; e.modifiers |= m & Qt::ShiftModifier ? EVENTFLAG_SHIFT_DOWN : 0; e.modifiers |= m & Qt::AltModifier ? EVENTFLAG_ALT_DOWN : 0; + e.modifiers |= b & Qt::LeftButton ? EVENTFLAG_LEFT_MOUSE_BUTTON : 0; e.modifiers |= b & Qt::RightButton ? EVENTFLAG_RIGHT_MOUSE_BUTTON : 0; e.modifiers |= b & Qt::MiddleButton ? EVENTFLAG_MIDDLE_MOUSE_BUTTON : 0; @@ -1043,12 +1044,10 @@ QCefViewPrivate::onViewWheelEvent(QWheelEvent* event) e.y = p.y(); // Prevent diagonal scrolling: only allow scrolling in one direction at a time - if (d.x() != 0 && d.y() != 0) { - if (std::abs(d.x()) > std::abs(d.y())) { - d.setY(0); - } else { - d.setX(0); - } + if (qAbs(d.x()) > qAbs(d.y())) { + d.setY(0); + } else { + d.setX(0); } pCefBrowser_->GetHost()->SendMouseWheelEvent(e, d.x(), d.y());