Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for mousewheel to zoom in/out #623

Merged
merged 2 commits into from
Nov 13, 2020

Conversation

iuhilnehc-ynos
Copy link

Fixes #605

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

Signed-off-by: Chen Lihui <Lihui.Chen@sony.com>
@iuhilnehc-ynos
Copy link
Author

iuhilnehc-ynos commented Nov 5, 2020

Hi, @jacobperron

From

/// Angle that the common vertical mouse wheel was rotated
int wheel_delta;

and message in the status bar "Right-Click/Mouse Wheel:: Zoom. ", I think we need to use e->angleDelta().y() to instead of e->angleDelta().x() in
wheel_delta(e->angleDelta().x()),
. (Of course, we can also update the comment "/// Angle that the common horizontal mouse wheel was rotated " and tip message, such as "Right-Click/Alt+Mouse Wheel:: Zoom. ".)

NOTE: https://doc.qt.io/qt-5/qwheelevent.html#angleDelta (angleDelta().y() provides the angle through which the common vertical mouse wheel was rotated since the previous event)

Signed-off-by: Chen Lihui <lihui.chen@sony.com>
@jacobperron jacobperron self-requested a review November 5, 2020 17:55
@jacobperron jacobperron self-assigned this Nov 6, 2020
@iuhilnehc-ynos
Copy link
Author

friendly ping @jacobperron 🔕

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

@jacobperron jacobperron added this to Proposed in Foxy Patch Release 4 via automation Nov 13, 2020
@jacobperron
Copy link
Member

jacobperron commented Nov 13, 2020

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status (unrelated warning)

@jacobperron jacobperron merged commit c661776 into ros2:ros2 Nov 13, 2020
jacobperron pushed a commit that referenced this pull request Nov 13, 2020
* 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>
@jacobperron jacobperron removed this from Proposed in Foxy Patch Release 4 Nov 13, 2020
jacobperron added a commit that referenced this pull request Nov 13, 2020
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zoom with mouse wheel not working
2 participants