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 incorrect input cursor position on MacOS with retina screen in use #1607

Merged
merged 9 commits into from
Nov 11, 2021
Merged

fix incorrect input cursor position on MacOS with retina screen in use #1607

merged 9 commits into from
Nov 11, 2021

Conversation

jmecn
Copy link
Contributor

@jmecn jmecn commented Sep 15, 2021

On MacOS, with retina screen in use, the input cursor position is incorrect. As the window size is not equals to camera resolution.

This PR use glfwGetWindowContentScale to get the scaling factor on window resolution, and apply it to GlfwMouseInput#onCursorPos callback. So we have the correct cursor position on MacOS.

For more information, there are the links:

This PR is also trying to fix part of issue #893

闫茂源 and others added 7 commits November 30, 2020 17:06
Let a 3 bytes UTF-8 data = [0xE4, 0x8A, 0xBC], when b = 0xE4 (1110 0100), it will be treated as 2 bytes.

See this part:

```java
            if (b < 0x80) {
                // good
            }
            else if ((b & 0xC0) == 0xC0) {//   (0xE4 & 0xC0) == 0xC0     =====>  true
                utf8State = UTF8_2BYTE;
            }
            else if ((b & 0xE0) == 0xE0) {//   (0xE4 & 0xE0) == 0xE0      =====>  true
                utf8State = UTF8_3BYTE_1;
            }
            else {
                utf8State = UTF8_ILLEGAL;
            }
```

3 bytes UTF-8 data while always be treated as 2 bytes UTF-8 data.

It's better that always treat String data as UTF-8 now.

see https://hub.jmonkeyengine.org/t/code-error-on-checking-utf-8-data/43909
…ll resolution framebuffers on Retina Display
…e don't get any callback when it is changed.So just get it from time to time when mouse cursor is moved.
@stephengold
Copy link
Member

Is this ready for review or integration? If not, please mark it as a draft.

@jmecn
Copy link
Contributor Author

jmecn commented Sep 18, 2021

Is this ready for review or integration? If not, please mark it as a draft.

It's ready, sir.

@stephengold
Copy link
Member

@tonihele please continue the conversations you started or else mark them as "resolved".

@stephengold stephengold added this to the v3.5.0 milestone Oct 24, 2021
@tonihele
Copy link
Contributor

tonihele commented Nov 4, 2021

Yep, sorry it took so long.

@stephengold
Copy link
Member

Unless there are objections, this will be integrated in about 24 hours.

@stephengold stephengold merged commit a3a77eb into jMonkeyEngine:master Nov 11, 2021
@stephengold
Copy link
Member

Changed the default setting for "UseRetinaFrameBuffer" to false in an attempt to solve issue #1745.

@stephengold
Copy link
Member

Further fixes proposed in PR #1746.

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.

3 participants