processing / processing/processing4
screenX etc. "broken" with pixelDensity(2) combined with JAVA2D renderer
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 494
- Forks
- 183
- Avg merge
- 4h 39m
- Merged PRs (30d)
- 3
Description
Created by: clankill3r
The following code:
void setup() {
size(600, 600, JAVA2D);
pixelDensity(2);
println(screenX(600, 0));
}
prints out 1200.
If I change the pixelDensity to 1 it prints out 600.
For P2D and P3D it will always be 600, no matter the pixelDensity (like it should be).
I compared the screenXImpl here are the results (not sure if this helps):
JAVA2D with pixelDensity 1
JAVA2D with pixelDensity 2
P2D with pixelDensity 1
P2D with pixelDensity 2
My first impression is that the pixelDensity 2 for JAVA2D is bit of a cheap hack. (But what do I know!).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied sketch with the JAVA2D renderer and compare its screenXImpl behavior at pixelDensity 1 and 2 with the P2D results described in the issue. Trace the renderer-specific screenX path and verify that screenX(600, 0) reports 600 regardless of pixel density, while preserving the existing behavior for the other renderers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100