GeezerVison is showing github.com — Set default pixel density to the display's density · Issue #950 · processing/processing4
Set default pixel density to the display's density #950DescriptionMost relevant area for this enhancement?
Core/Environment/Rendering
Feature to enhance
pixelDensity()
Desired enhancement
Currently, Processing defaults to pixelDensity(1), requiring users to manually set pixelDensity(2) or pixelDensity(displayDensity()) for high-DPI support. This proposal sets the default to the display's actual density, improving visual quality by default while allowing users to override it.
Potential benefits
Sharper rendering on high-DPI displays.
Possible drawbacks
No response
Additional context
No response
Would you like to work on the issue?
This is a small change which would make a good first issue. I'm happy to leave it to a new contributor. Activityyehiarasheed commented on Mar 2, 2025 I can work on this issue, please assign it to me. I will follow up with a proposed solution here as well since this is the first time for me to contribute to this repo. yehiarasheed commented on Mar 13, 2025 Hello @Stefterv @SableRaf,
Just to make sure that I'm on the right track for solving this issue, I've tried setting the pixelDensity variable in the PApplet.java class dynamically by calling the displayDensity() method as the assignment value.
That said, whenever I try to set the pixel density to 1 using pixelDensity(1), it works just fine. Even if I call pixelDensity(int density) multiple times in the sketch, the last method call is the one that actually sets the value of the pixelDensity variable.
I know that the pixelDensity(int density) method is supposed to be called only once (as mentioned in the JavaDocs), but I tested calling it multiple times, and it worked as expected.
Demo
Normal Scaling
Normal.Scaling.Non-HiDPI.mode.mp4
Custom scaling (Hi-DPI)
High.Scaling.HiDPI.mode.mp4
Stefterv commented on Mar 24, 2025 Hi @yehiarasheed Sorry for not replying earlier,
This change is best to be as minimal as possible, if you find other issues on the way, please create separate PR's for those or just document them through a separate issue. Reacted by Raphaël de Courville yehiarasheed commented on Mar 24, 2025 Hi @Stefterv, no worries! I now understand that you're aiming for a minimal enhancement—I initially thought Jim's comments reflected the entire team's vision. Reacted by Raphaël de Courville Stefterv commented on Apr 15, 2025 Thanks for jumping in on this! Since it was just a quick one-line fix and we needed it for an upcoming release, I went ahead and made the change directly. Really appreciate your help though! Would love to see you contribute to other issues and I am happy to support you with those! yehiarasheed commented on Apr 15, 2025 Hey @Stefterv, I totally get it. Unfortunately I've broken my arm so I took some time off for recovery, I'll be happy to work on other issues! Reacted by Raphaël de Courville Stefterv commented on Apr 15, 2025 Oh sorry to hear that! Have a good recovery and we'll see you again soon. 💙
MetadataMetadataStatusShow more project fields
DevelopmentNo branches or pull requestsIssue actions
|