-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fixed transform control example #221
Conversation
Codecov Report
@@ Coverage Diff @@
## ign-rendering3 #221 +/- ##
==================================================
- Coverage 53.23% 53.18% -0.05%
==================================================
Files 131 131
Lines 12007 12027 +20
==================================================
+ Hits 6392 6397 +5
- Misses 5615 5630 +15
Continue to review full report at Codecov.
|
could be related to gazebosim/gz-sim#147 |
6ce2df9
to
95a6347
Compare
@iche033 I completely changed the PR, do you mind to have another look ? |
interesting, so you have different xScale and yScale values? |
The changes look good to me. I'm not able to reproduce this issue on my laptop though. @jennuine do you still have this issue? If so, do you mind testing to see if this fixes the problem? |
Yes, I have xScale = 80 and yScale 81,5. But I think the main issue was that if the scale is lower than the DPI then no scale is needed |
I still have this issue and unfortunately the changes did not fix the problem for me |
Thank you for testing it @jennuine, can you remove this comment ? And post the output here. |
|
I think the code you're searching for Windows is:
I did a test on my computer with screen scaling set to 125%, with a FullHD 21,5" display:
I think it corresponds to the values you're trying to get in X11. However, the transform control example works for me even without this patch on Windows. Docs here: https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-getdevicecaps . The GetDeviceCaps method returns some "generic" DPI common to all screens, but I think it might be better than nothing. You can also use Also, the current implementation of the added |
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.
include/ignition/rendering/Utils.hh
Outdated
/// \brief Get the screen scaling factor. | ||
/// \param[out] _xScale The X screen scaling factor. | ||
/// \param[out] _yScale The Y screen scaling factor. | ||
/// \return The screen scaling factor. |
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.
Return is void
😉
I believe this issue has been manifesting on CI, see #170. The |
I pushed some tweaks in 58a0857:
I also tracked down the history of the scaling factor.
With that in mind, I tried setting the scaling to 1.0 and voilà, it worked like a charm. I don't really understand why the resolution we get from the calculation is different from the one reported by So I see 3 different setups in this thread:
@jennuine , @ahcorde : can you try 1.0 / 1.0 scaling just for fun? I'd also be interested in seeing if @nkoenig could test the laptop that gave origin to the scaling in the first place. |
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
58a0857
to
c10a6bb
Compare
it's working for me, I retarget this to |
It's working for me with or without the PR now... With the PR, I tested both as is and with scaling 1.0 and it works either way. Without the PR, I've tested this on Citadel, Dome, and Edifice and all work as expected now. 🤔 I don't know what could have changed between now and then? Maybe @mabelzhang can give it a try, I believe she had come across this issue awhile ago too. |
@ahcorde , you mean with this PR or with 1.0 or both? |
I only tried 1.0 |
I have a suggestion in #381 for a way to let each user calibrate their screens independently. |
I'm closing this in favor of #446, which was merged into Fortress. We can backport that if needed. |
I found an issue in the rendering examples, in particular in the
transform_control
example. When I try to click in the arrows or in one of the other Gizmo visuals is not getting the visual. I need to click in other part of the screen. See the gif below.With this fix I'm able to get the right visual:
This is also happening in ign-gazebo.
Signed-off-by: ahcorde [email protected]