Region setPrefSize behaves differently if width == Double.MAX_VALUE versus height == Double.MAX_VALUE

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 8u40
    • Component/s: javafx
    • None
    • Environment:

      Mac, Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b21), JavaFX runtime b1165

      In the following sample, if the pref size of the pane is 100, Double.MAX_VALUE, I would expect a 100 px wide window that fills the height of the screen. The window is the right width, but the height is zero (or darned close - maybe one or two px). RT-38193 not withstanding, if the pref size is Double.MAX_VALUE, 100 we get a 100px high window that spans the width of the screen (as expected).

          @Override
          public void start(Stage primaryStage) {
              Pane pane = new Pane();
      // pane.setPrefSize(Double.MAX_VALUE, 100);
              pane.setPrefSize(100,Double.MAX_VALUE);
              Scene scene = new Scene(pane);
              primaryStage.setScene(scene);
              primaryStage.show();
          }

            Assignee:
            Unassigned
            Reporter:
            David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: