Skip to content

screenX etc. "broken" with pixelDensity(2) combined with JAVA2D renderer #557

Open
@processing-bot

Description

@processing-bot

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_PD1

JAVA2D with pixelDensity 2

_JAVA2D_PD2

P2D with pixelDensity 1

_P2D_PD1

P2D with pixelDensity 2

_P2D_PD2

My first impression is that the pixelDensity 2 for JAVA2D is bit of a cheap hack. (But what do I know!).

Metadata

Metadata

Assignees

No one assigned

    Labels

    has attachmentAttachment was not transfered from GitLab

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions