Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this behavior indicative of a bug? #81

Open
xiz2008shy opened this issue Apr 9, 2024 · 1 comment
Open

Is this behavior indicative of a bug? #81

xiz2008shy opened this issue Apr 9, 2024 · 1 comment

Comments

@xiz2008shy
Copy link

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();

like this
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();

Snipaste_2024-04-09_12-37-27

I'm wondering if this behavior is a bug in the openJFX library

@xiz2008shy
Copy link
Author

Additionally, I ran it on the OpenJFX 22 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant