forked from j62/ctbrec
1
0
Fork 0

Fix rounded corners for portrait images

This commit is contained in:
0xb00bface 2021-08-23 15:32:46 +02:00
parent 56ca4d50de
commit 6d17b0413c
1 changed files with 2 additions and 3 deletions

View File

@ -17,7 +17,6 @@ public class ImageTableCell extends ClickableTableCell<Image> {
imageView.prefHeight(64); imageView.prefHeight(64);
imageView.setFitHeight(64); imageView.setFitHeight(64);
setPadding(new Insets(5)); setPadding(new Insets(5));
setGraphic(imageView); setGraphic(imageView);
} }
@ -29,7 +28,7 @@ public class ImageTableCell extends ClickableTableCell<Image> {
double columnWidth = getTableColumn().getWidth(); double columnWidth = getTableColumn().getWidth();
Insets pd = getPadding(); Insets pd = getPadding();
var height = columnWidth - pd.getTop() - pd.getBottom(); var height = columnWidth - pd.getTop() - pd.getBottom();
var width = columnWidth - pd.getLeft() - pd.getRight() - 3; var width = columnWidth - pd.getLeft() - pd.getRight();
imageView.prefHeight(height); imageView.prefHeight(height);
imageView.setFitHeight(height); imageView.setFitHeight(height);
imageView.prefWidth(width); imageView.prefWidth(width);
@ -37,7 +36,7 @@ public class ImageTableCell extends ClickableTableCell<Image> {
var clip = new Rectangle(width, height); var clip = new Rectangle(width, height);
clip.setArcHeight(10); clip.setArcHeight(10);
clip.arcWidthProperty().bind(clip.arcHeightProperty()); clip.setArcWidth(10);
imageView.setClip(clip); imageView.setClip(clip);
} }
super.requestLayout(); super.requestLayout();