-
Bug
-
Resolution: Fixed
-
P3
-
8
-
jdk1.8.0 b85
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;
}
}
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;
}
}