The first block of code does not encapsulate the StackPane within an AnchorPane, and it results in the observed discrepancy in the corner radii:
StackPane sp = new StackPane();
//AnchorPane ap = new AnchorPane(sp);
Rectangle rectangle = new Rectangle(100.0, 100.0);
rectangle.setArcWidth(10.0);
rectangle.setArcHeight(10.0);
sp.setPrefSize(100.0, 100.0);
sp.setMaxWidth(100.0);
sp.setMaxHeight(100.0);
sp.setShape(rectangle);
sp.setClip(rectangle);
sp.setStyle("-fx-background-color: red");
Scene scene = new Scene(sp, 600.0, 700.0);
primaryStage.setScene(scene);
primaryStage.show();
However, when i wrap the StackPane with an AnchorPane, as shown in the second block of code, the issue appears to be resolved:
StackPane sp = new StackPane();
AnchorPane ap = new AnchorPane(sp);
Rectangle rectangle = new Rectangle(100.0, 100.0);
rectangle.setArcWidth(10.0);
rectangle.setArcHeight(10.0);
sp.setPrefSize(100.0, 100.0);
sp.setMaxWidth(100.0);
sp.setMaxHeight(100.0);
sp.setShape(rectangle);
sp.setClip(rectangle);
sp.setStyle("-fx-background-color: red");
Scene scene = new Scene(ap, 600.0, 700.0);
primaryStage.setScene(scene);
primaryStage.show();
I'm wondering if this behavior is a bug in the openJFX library
The first block of code does not encapsulate the StackPane within an AnchorPane, and it results in the observed discrepancy in the corner radii:
I'm wondering if this behavior is a bug in the openJFX library