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

Boxes around mapping sometimes get offset from the text #453

Open
PiTheGuy opened this issue Jun 29, 2022 · 2 comments
Open

Boxes around mapping sometimes get offset from the text #453

PiTheGuy opened this issue Jun 29, 2022 · 2 comments

Comments

@PiTheGuy
Copy link

This usually happens when scrolling to the right a lot, but how far you have to scroll isn't consistent. It's also happened without scrolling before.

Reference image:
image

@NebelNidas
Copy link
Contributor

NebelNidas commented Dec 23, 2023

What I've found so far:

  • The issue is unrelated to Swing-DPI.
  • Our HighlightPainters aren't at fault either, the DefaultHighlightPainter produces the same results.
  • The incorrect positioning only occurs when OS-level fractional scaling is used, integer scaling (e.g. 100%, 200%) works fine.
  • It's not caused by us still using the legacy Rectangle class instead of the new Rectangle2D.
  • Therefore I conclude this must be either some sort of Swing or SyntaxPane issue.

@NebelNidas
Copy link
Contributor

NebelNidas commented Dec 23, 2023

Some test results (font sizes measured from incl. 9 to incl. 33):

Monitor resolution OS Scaling Enigma Scaling Working Editor Font Sizes
2560x1440 125% 100% 13, 20, 26/27, 33
125% 10, 16, 21, 26, 32
150% 18, 22, 31
175% 15, 19, 23, 27, 30
200% 10, 13, 20, 23, 30, 33
150% 100% 10, 13, 20, 23, 30, 33
125% 16, 24, 32
150% 20, 22
175% 17, 19, 23
200% 10, 15, 20, 25, 30

If anyone notices any correlations between those numbers, please comment.

What's interesting is that the caret position is offset too (just like the markers). Here for example, the caret hasn't been moved at all, I only increased the zoom level (the first image is correct):
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants