-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
8u40
-
None
I would expect a line with a strokeDashArray of 30, 15, 0, 15 to not show any line at all for the zero length 'pen down' dash. But it does if the StrokeLineCap is SQUARE or ROUND. It does not if the StrokeLineCap is BUTT.
@Override
public void start(Stage primaryStage) throws Exception {
Line line = new Line(0,0,150,0);
line.getStrokeDashArray().setAll(30d, 15d, 0d, 15d);
line.setStrokeLineCap(StrokeLineCap.BUTT);
StackPane stackPane = new StackPane();
stackPane.setPrefSize(200,200);
stackPane.getChildren().add(line);
RadioButton butt = new RadioButton(StrokeLineCap.BUTT.name());
butt.setOnAction(e -> line.setStrokeLineCap(StrokeLineCap.BUTT));
RadioButton round = new RadioButton(StrokeLineCap.ROUND.name());
round.setOnAction(e -> line.setStrokeLineCap(StrokeLineCap.ROUND));
RadioButton square = new RadioButton(StrokeLineCap.SQUARE.name());
square.setOnAction(e -> line.setStrokeLineCap(StrokeLineCap.SQUARE));
ToggleGroup toggleGroup = new ToggleGroup();
toggleGroup.getToggles().setAll(butt,round,square);
toggleGroup.selectToggle(butt);
VBox root = new VBox(5, stackPane, butt, round, square);
root.setPadding(new Insets(10,10,10,10));
primaryStage.setScene(new Scene(root,200,200));
primaryStage.show();
}
@Override
public void start(Stage primaryStage) throws Exception {
Line line = new Line(0,0,150,0);
line.getStrokeDashArray().setAll(30d, 15d, 0d, 15d);
line.setStrokeLineCap(StrokeLineCap.BUTT);
StackPane stackPane = new StackPane();
stackPane.setPrefSize(200,200);
stackPane.getChildren().add(line);
RadioButton butt = new RadioButton(StrokeLineCap.BUTT.name());
butt.setOnAction(e -> line.setStrokeLineCap(StrokeLineCap.BUTT));
RadioButton round = new RadioButton(StrokeLineCap.ROUND.name());
round.setOnAction(e -> line.setStrokeLineCap(StrokeLineCap.ROUND));
RadioButton square = new RadioButton(StrokeLineCap.SQUARE.name());
square.setOnAction(e -> line.setStrokeLineCap(StrokeLineCap.SQUARE));
ToggleGroup toggleGroup = new ToggleGroup();
toggleGroup.getToggles().setAll(butt,round,square);
toggleGroup.selectToggle(butt);
VBox root = new VBox(5, stackPane, butt, round, square);
root.setPadding(new Insets(10,10,10,10));
primaryStage.setScene(new Scene(root,200,200));
primaryStage.show();
}
- relates to
-
JDK-8097253 StrokeDashArray length affected by LineCapProperty
-
- Closed
-