Hello @esc746,
I just had the same issue!
NOTE :
Results may vary depending on version used!
I was using Processing 4.3.4 (error checking works) and Processing 4.4.4 (error checking broken) and they give different results depending on renderer.
How to disable scaling in JavaFX so it behaves like Processing:
You may be able to (see comment above!) turn off automatic DPI scaling in JavaFX by setting a system property:
System.setProperty("glass.win.uiScale", "1");
The above only seemed to work when starting a new FX2D PApplet (minimal code):
// NOTE:
// In W10 you also need to add the JavaFX JAR files to the sketch in a "code" folder. // Search forum for this discussion.
import processing.javafx.*;
// Corrected some "Type is ambiguous" errors
import javafx.scene.paint.Color;
import javafx.stage.Screen;
//Renderer Applets:
renderApp app; // FX2D
public void settings()
{
size(300, 300);
}
public void setup()
{
// Testing:
System.setProperty("glass.win.uiScale", "1"); // This works!
//displayDensity(1); //If needed!
surface.setVisible(true);
surface.setLocation(10, 10);
app = new renderApp();
Thread thread = new Thread(() -> PApplet.runSketch(new String[]{"renderApp"}, app));
thread.start();
}
public void draw()
{
background(0, 255, 0);
}
// FX2D
public class renderApp extends PApplet
{
public void settings()
{
size(300, 300, FX2D);
}
public void setup()
{
println(Screen.getPrimary().getOutputScaleX());
surface.setVisible(true);
surface.setLocation(320, 10);
Stage primaryStage = new Stage();
Pane root = new Pane();
root.setBackground(new Background(new BackgroundFill(Color.RED, null, null)));
Scene scene = new Scene(root, 300, 300);
primaryStage.setTitle("JavaFX Window");
primaryStage.setScene(scene);
primaryStage.setX(600+30);
primaryStage.setY(10);
primaryStage.show();
}
void draw()
{
background(255, 255, 0);
}
}
:)