-
Notifications
You must be signed in to change notification settings - Fork 44
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 large / unexpected camera movements #502
Conversation
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linters
fixed. 23d8993 |
Codecov Report
@@ Coverage Diff @@
## ign-gui6 #502 +/- ##
============================================
- Coverage 67.46% 66.95% -0.51%
============================================
Files 39 39
Lines 5286 5290 +4
============================================
- Hits 3566 3542 -24
- Misses 1720 1748 +28
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had just one questions. Otherwise, works great.
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen ichen@osrfoundation.org
🦟 Bug fix
Related issue: gazebosim/gz-sim#1085
Summary
Fixes large / unexpected camera movement when orbiting / panning due to missing mouse events.
More info:
The
Minimal Scene
is responsible for propagating all mouse events to other GUI plugins. However, mouse events were continuously overriden by the latest ones before they can be propagated / processed. This causes important events like a mouse press to be lost. TheInteractive View Control
relies on mouse press pos to determine the anchor point for camera orbiting and panning, so if it misses a mouse press pos, it justs uses the last anchor point for camera movements. When the anchor point is far away, it causes large camera jumps.This gif shows the problem. The first pan motion successfully sets the anchor point (yellow ellipsoid). Subsequent camera orbit and pan motions miss the mouse press events and thus they still use the old anchor point that's on top of the red box.
This PRs fixes the issue by storing mouse events in a list in
Minimal Scene
instead of just the latest event, and makes sure that theInteractive View Control
always handles mouse press events.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.