Skip to content

MacOS surface-scale fix#35

Merged
wcmatthysen merged 2 commits intoWorldWindEarth:developfrom
wcmatthysen:macos-pixel-scale-fix
May 22, 2019
Merged

MacOS surface-scale fix#35
wcmatthysen merged 2 commits intoWorldWindEarth:developfrom
wcmatthysen:macos-pixel-scale-fix

Conversation

@wcmatthysen
Copy link
Copy Markdown
Member

@wcmatthysen wcmatthysen commented Apr 17, 2019

Description of the Change

According to @pcmehlitz, if we update to the latest version of JOGL and we do not explicitly set the surface-scale factor to 1.0 in the different constructors of WorldWindowGLCanvas, we will end up with a
surface-scale factor of 2.0 on MacOS machines with high-DPI displays. To quote his original commit-message:

"there is one more serious issue that manifests at least on OX X machines with high DPI (e.g. Macbook Pros with retina display). If we do not explicitly request pixel scale factors of 1.0 in the worldwind.awt.WorldWindowGLCanvas, we end up with factors of 2.0 after the GLCanvas is realized, which then causes all AWTInputHandler mouse callbacks to receive MouseEvents with wrong coordinates (0.5 of what they should be), which in turn causes operations that compute world coordinates from screen coordinates to fail (e.g. click-to-re-center)."

See: pcmehlitz@3c8322d

Unfortunately I do not own a Mac, so I can't test this on my side. Can we get this tested by someone else to confirm that it works.

Why Should This Be In Core?

Critical bug-fix for MacOS users.

Benefits

Improving the stability of the code-base.

Potential Drawbacks

None

Applicable Issues

None

According to @pcmehlitz, if we update to the latest version of JOGL and
we do not explicitly set the surface-scale factor to 1.0 in the
different constructors of WorldWindowGLCanvas, we will end up with a
surface-scale factor of 2.0 on MacOS machines with high-DPI displays. To
quote his original commit-message:

"there is one more serious issue that manifests at least on OX X machines
with high DPI (e.g. Macbook Pros with retina display). If we do not
explicitly request pixel scale factors of 1.0 in the
worldwind.awt.WorldWindowGLCanvas, we end up with factors of 2.0 after
the GLCanvas is realized, which then causes all AWTInputHandler mouse
callbacks to receive MouseEvents with wrong coordinates (0.5 of what
they should be), which in turn causes operations that compute world
coordinates from screen coordinates to fail (e.g. click-to-re-center)."

See: pcmehlitz@3c8322d
@wcmatthysen wcmatthysen added the bug Something isn't working label Apr 17, 2019
@wcmatthysen wcmatthysen added this to the WWJ-CE 2.2.0 milestone Apr 17, 2019
Moved the set-surface-scale logic out of the constructors into a
separate method called initializeSurfaceScale(). We call this method
from the different constructors.
@wcmatthysen
Copy link
Copy Markdown
Member Author

@emxsys, I think we can merge this as it is a default step that should have been taken originally to get the scale-factor right on Macs.

@wcmatthysen wcmatthysen merged commit 563f37f into WorldWindEarth:develop May 22, 2019
@wcmatthysen wcmatthysen deleted the macos-pixel-scale-fix branch May 22, 2019 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant