jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

The render window is scaled improperly in Python mode when Windows display scale is set to greater than 100% #353

Open Metamere opened 2 years ago

Metamere commented 2 years ago

In Python mode, the render window, but not the image resolution, is scaled up to match the Windows display scale, making things very jagged. When I switch the display to 100% scale it renders properly at the same size as Java mode. Save() creates an image of the proper size regardless of the display scale. To test, just set the Windows display scale to 150% like I do for my 2560x1440 display. The image below compares the render windows for Python and Java modes, with the code used included below it. I searched for duplicates of this issue, and asked for help in the forums and in a Discord group, so I believe this is a valid bug to report.

I am using version 4.0 beta 8, on Windows 10. I also tested it in version 3.5.4 and it had the same issue.

python java comparison

Here is the code for the Python test:

def setup(): size(300,300) background(255) draw_shape() save("Python_test.tif")

def draw_shape(): line(0, 0, width, height) translate(width.5,height.5) rotate(radians(45)) fill(0) rectMode(CENTER) rect(0,0,100,100)

And here is the code for the Java test:

void setup(){ size(300,300); background(255); draw_shape(); save("Java_test.tif"); } void draw_shape(){ line(0, 0, width, height); translate(width.5,height.5); rotate(radians(45)); fill(0); rectMode(CENTER); rect(0,0,100,100); }