Skip to content

Commit

Permalink
Fix for mousewheel to zoom in/out (#623) (#626)
Browse files Browse the repository at this point in the history
* Fix for mousewheel to zoom in/out

Signed-off-by: Chen Lihui <Lihui.Chen@sony.com>

* Use vertical mouse wheel to test

Signed-off-by: Chen Lihui <lihui.chen@sony.com>

Co-authored-by: Chen Lihui <lihui.chen@sony.com>
  • Loading branch information
jacobperron and Chen Lihui committed Nov 13, 2020
1 parent 27d198f commit ad609a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rviz_common/src/rviz_common/viewport_mouse_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ViewportMouseEvent::ViewportMouseEvent(RenderPanel * p, QWheelEvent * e, int lx,
x(e->x() * device_pixel_ratio),
y(e->y() * device_pixel_ratio),
#endif
wheel_delta(e->angleDelta().x()),
wheel_delta(e->angleDelta().y()),
acting_button(Qt::NoButton),
buttons_down(e->buttons()),
modifiers(e->modifiers()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ViewControllerTestFixture : public DisplayTestFixture
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
auto global_point = QPointF();
auto pixel_delta = QPoint();
auto angle_delta = QPoint(delta, 0);
auto angle_delta = QPoint(0, delta);
auto mouseEvent = new QWheelEvent(
point,
global_point,
Expand All @@ -113,7 +113,7 @@ class ViewControllerTestFixture : public DisplayTestFixture
false);
#else
auto mouseEvent = new QWheelEvent(
point, delta, Qt::NoButton, Qt::NoModifier, Qt::Orientation::Horizontal);
point, delta, Qt::NoButton, Qt::NoModifier);
#endif
return {render_panel_.get(), mouseEvent, 0, 0};
}
Expand Down

0 comments on commit ad609a6

Please sign in to comment.