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

Children are rendered outside the tile pane bounds.

    XMLWordPrintable

Details

    Description

      Bug is reproducible with BASELINE_CENTER, BASELINE_LEFT, BASELINE_RIGHT

      import com.sun.javafx.runtime.VersionInfo;
      import javafx.application.Application;
      import javafx.geometry.Pos;
      import javafx.scene.Scene;
      import javafx.scene.layout.Pane;
      import javafx.scene.layout.TilePane;
      import javafx.scene.paint.Color;
      import javafx.scene.shape.Rectangle;
      import javafx.stage.Stage;

      public class Main extends Application {

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

          @Override
          public void start(Stage stage) throws Exception {
              stage.setTitle(VersionInfo.getRuntimeVersion());
              stage.setScene(createScene());
              stage.show();
          }

          private Scene createScene() {
              TilePane tile = new TilePane();
              tile.setPrefSize(150, 150);
              tile.setTileAlignment(Pos.CENTER_LEFT);
              for (int i = 0; i < 15; i++) {
                  tile.getChildren().add(new Rectangle(20, 20, (i % 2 == 0) ? Color.RED : Color.BLUE));
              }

              tile.setStyle("-fx-pref-tile-width:40;-fx-pref-tile-height:35;-fx-tile-alignment:BASELINE_CENTER");
              
              Pane root = new Pane();
              root.setStyle("-fx-border-color:BLACK");
              root.setPrefSize(200, 200);
              
              root.getChildren().add(tile);
              root.setTranslateX(100);
              root.setTranslateY(100);
              Scene scene = new Scene(root, 600, 400);
              return scene;
          }
      }

      Attachments

        Activity

          People

            ekrejcir Eva Krejčířová (Inactive)
            dzinkevi Dmitry Zinkevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: