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

Improved zoom on windows #31

Closed
processing-bot opened this issue Nov 24, 2019 · 14 comments
Closed

Improved zoom on windows #31

processing-bot opened this issue Nov 24, 2019 · 14 comments

Comments

@processing-bot
Copy link
Collaborator

Created by: sampottinger

Right now display scaling on Windows 10 causes poor automatic zooming through Swing. This makes the interface appear pixelated and the custom swing elements (primarily JEditTextArea) do not calculate x positions for the caret correctly. After #30, automatic swing zooming will be disabled. While this improves the experience for windows users that have display scaling enabled, this is a poor accessibility experience. I would like to re-enable automatic zoom on Windows and, ideally, extend zoom into native swing elements like the menu bar as well. However, as described in #30, we will need a new way to detect display scaling.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Hey @benfry, I saw your comment on #30:

So if I understand this correctly, it's a step backwards and things look worse, but at least it fixes the cursor placement issues?

Here's is where things are at:

Prior to #30 without display scaling Prior to #30 with display scaling After #30 without display scaling After #30 with display scaling
Editor apperance Pixelated
Cursor placement Incorrect
UI Size The scaling does not impact size unless set manually in Processing preferences.
Sketch size
Sketch appearance Not zoomed Not zoomed

Note that this is all referring to windows display scaling and not the zoom in Processing preferences. This changed in Java 11 because of automatic sizing introduced by JEP 263 for Windows.

I am continuing to work on this here inside this bug. Ideally, we would handle the sizing ourselves but the old WindowsPlatform code to detect DPI no longer works under Java 11.

(Update: it looks like sketches are rendering OK but they are not scaled)

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

This is effectively a continuation of #21 but, now that #30 has merged, Processing is usable on Windows with display scaling enabled.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

An update on this... It looks like one cannot get to the display scaling via GraphicsConfiguration or the sun.java2d system properties. We might have to use JNA.

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Bummer; hoped this stuff was gonna get easier with 11+.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

@benfry - same :(

Alright, I might have a solution at https://github.com/processing/processing4/tree/jna_windows_scaling. Hoping to do just a little more testing though...

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

I actually could use a little help in testing this. @kllsamui (or other Windows members of the community) - would you be willing to give https://github.com/processing/processing4/tree/jna_windows_scaling a shot? If needed, I can make a build available for you.

@processing-bot
Copy link
Collaborator Author

Created by: kllsamui

yes, happy to test, please link to build and detail test procedure ( ? change windows settings ? processing settings ?)

@processing-bot
Copy link
Collaborator Author

Created by: Volts-s

Hi all, I would be happy to help out with testing this or anything else. I have a Windows 10 desktop and a MacBook Pro with retina display. I'm not set up to build Processing at the moment.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Hey there! Very sorry for the delay. Please see https://github.com/sampottinger/processing4/releases/tag/v4.0-alpha-jna-scale. This is provided under the usual license: https://github.com/processing/processing4/blob/master/LICENSE.md. Please follow the following:

  • Start processing
  • Go to processing settings and ensure automatic scaling is on (File > Preferences)
  • Close processing
  • Enable display scaling at 125% (Start > Settings > System > Display)
  • Start processing and note if the interface looks pixelated.
  • Type a long line of text like the following: aslidfjaoisfdjaioncasldijadlsfkjasdlfjaoicnasodifjsdalfj. Please record if the cursor is aligned with the text correctly at the end of the line.
  • Close Processing
  • Reset display scaling to 100% (Start > Settings > System > Display)
  • Start processing and note if the interface looks pixelated.
  • Type a long line of text like the following: aslidfjaoisfdjaioncasldijadlsfkjasdlfjaoicnasodifjsdalfj. Please record if the cursor is aligned with the text correctly at the end of the line.

Please let me know how that goes and thanks!

@processing-bot
Copy link
Collaborator Author

Created by: kllsamui

-0- repeat ( old system i call here 4.0 c )

p4_c_cursorproblem

_ download / test 4.0 d scale test
-1- got a problem about a 3rd party library i test / but not have that problem with p 3.5.3

p4_scale_0

after deleted that library

-2- win scale 125%

p4_scale_1

OK

030 win scale 100%

p4_scale_2

OK

( i did not play with the processing scaling, only windows, was this correct? )

looks like you solved it
THANK YOU VERY MUCH

@processing-bot
Copy link
Collaborator Author

Created by: Volts-s

This looks good to my eyes.

Scaling 125 % --------------------
jna_windows_scaling_125_percent

Scaling 100 % ------------------
jna_windows_scaling_100_percent

Many thanks to you and Ben Fry for your work on Processing 4.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Fantastic thank you @Volts-s and @kllsamui! I'll update the PR and get this in.

@processing-bot
Copy link
Collaborator Author

Created by: kllsamui

can you make a version for RPI?

i would love to compile and run it on/for the Raspberry Pi ( RPI 3B+ hardware for now )

++ and also do it for the several video libraries
like today buster update breaks my last GLVideo repair

and the newest RPI buster
works with the https://github.com/processing/processing-video/releases/tag/r6-v2.0-beta4 only
( works on RPI 3 and RPI4 different regarding USB video )
but not at all with contribution manager / video / glvideo /

BUT i would need someone to talk me through.

@processing-bot
Copy link
Collaborator Author

Created by: github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant