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

Children are rendered outside the tile pane bounds.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      jdk1.8.0 b85

      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

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: