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

Percentage values for BorderWidths are treated as absolute widths

XMLWordPrintable

      If a BorderWidth has percentage based widths, the code in NGRegion and in picking on Region doesn't take this state into account but instead treats the widths as absolute values.


      public class HelloRegion extends Application {
          @Override public void start(Stage primaryStage) throws Exception {
              final Pane region = new Pane();
              region.relocate(10, 10);
              region.setPrefSize(100, 100);
              final BorderStroke b1 = new BorderStroke(Color.RED, BorderStrokeStyle.SOLID, new CornerRadii(20), new BorderWidths(.1, .06, .04, .02, true, true, true, true), Insets.EMPTY);
              region.setBorder(new Border(b1));

              Group group = new Group();
              group.getChildren().addAll(region);
              Scene scene = new Scene(group, 300, 300);

              primaryStage.setScene(scene);
              primaryStage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }
      }

            rbair Richard Bair (Inactive)
            rbair Richard Bair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: