Skip to content

Scaling and AA Issue with Canvas #378

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

Closed
processing-bot opened this issue Jan 28, 2022 · 10 comments
Closed

Scaling and AA Issue with Canvas #378

processing-bot opened this issue Jan 28, 2022 · 10 comments
Labels

Comments

@processing-bot
Copy link
Collaborator

Created by: pigsteel

Description

Following b3 (specifically the scaling fixes for windows 10 and 11) the canvas size multiplies by scaling rather than staying at its specified size. Have not noticed any anti-aliasing problems related to this on windows 10 but on windows 11 (on any anti aliasing/smoothing settings) sprites and images are blocky and pixelated

Switching back to b2 fixes canvas

Expected Behavior

Canvas should follow pixel-measured size defined in size setting

Current Behavior

Does not do this, multiplies by windows Scale setting and creates anti aliasing issues & pixelation

Steps to Reproduce

  1. Should happen on any windows device running b3 or b4

Your Environment

  • Processing version: 4.0b4, 4.0b3
  • Operating System and OS version: Windows 11 64-bit 21H2
  • Other information: Scaled to 125% (Default)

Possible Causes / Solutions

@processing-bot
Copy link
Collaborator Author

processing-bot commented Jan 28, 2022

Created by: pigsteel

Image
Pixelated shapes on canvas (Windows 11)

@processing-bot
Copy link
Collaborator Author

processing-bot commented Jan 28, 2022

Created by: pigsteel

Image
Jagged edges on canvas sprite

@processing-bot
Copy link
Collaborator Author

processing-bot commented Jan 28, 2022

Created by: pigsteel

Image
Expected behaviour in processing b2 (Much smaller window)

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Beta 4 should now be doing the correct thing… scaling up a sketch if you haven't specified pixelDensity(), just like it does on macOS. Check what displayDensity() is returning for you (hopefully 2), and if you want to use the 2x version of things, call pixelDensity(displayDensity()).

@processing-bot
Copy link
Collaborator Author

Created by: pigsteel

I'll check. I remember briefly experimenting with those settings and it not fixing anything but I might be wrong

@processing-bot
Copy link
Collaborator Author

Created by: pigsteel

Display density returned 1. Messed around with pixel density to no avail

@processing-bot
Copy link
Collaborator Author

processing-bot commented Feb 7, 2022

Created by: Omnificator

I have the same issue on Windows 10, FullHD, scaled to 125%.
I've tried to override high DPI settings for the editor, java.exe and javaw.exe, with no result. The sketch window remains upscaled and pixelised. displayDensity() is 1.
It is actual for Processing 4.0b5, not for 4.0b3 (unfortunalely I can't return to 4.0b3 because of Windows Defender caution).

size(400, 400);
for(int d = 360; d >= 40; d -= 40) {
  circle(200, 200, d);
}

Here is the output:

aa

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Yuck, ok—will have to check into it further. We're not doing any scaling, certainly, it's just that we have to figure out what Windows is doing to be “smart” and shut it off.

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Ok, sorted out for beta 6. The solution is to detect the current Windows scaling (difficult, requires native code) and then override it to either 1x or 2x based on what's likely to work best in the situation.

Longer explanations of all of it: https://github.com/processing/processing4/tree/master/build/windows/fenster

@processing-bot
Copy link
Collaborator Author

Created by: github-actions[bot]

This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs.

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

No branches or pull requests

1 participant