Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8089067

line-joins are not mitered in css

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • fx2.0.2
    • javafx
    • JavaFX 2.1b8, Win7, GeForce GTX460 graphics

      The following code should create a button with a mitered border similar to the inset border style seen here: http://www.w3schools.com/cssref/playit.asp?filename=playcss_border-style&preval=inset

      button.setStyle("-fx-background-color: null; -fx-border-width: 5; -fx-border-color: black grey grey black; -fx-border-style: solid line-join miter 45;");

      However the line-join does not work as expected as the joins end up square rather than mitered.

      Refer to https://forums.oracle.com/forums/thread.jspa?threadID=2333665 for a related discussion.

      Sample test program:

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.*;
      import javafx.stage.Stage;
      public class MiteredButtonStyle extends Application {
        public static void main(String[] args) throws Exception { launch(args); }
        public void start(final Stage stage) throws Exception {
          Button button = new Button("My lines-joins are square, not mitered");
          button.setStyle("-fx-background-color: null; -fx-border-width: 5; -fx-border-color: black grey grey black; -fx-border-style: solid line-join miter 45;");
          stage.setScene(new Scene(VBoxBuilder.create().spacing(10).children(button).style("-fx-background-color: azure; -fx-padding: 20; -fx-font-size:20;").build()));
          stage.show();
        }
      }

            Unassigned Unassigned
            josmithjfx John Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported: