forked from j62/ctbrec
Fix rounded corners for portrait images
This commit is contained in:
parent
56ca4d50de
commit
6d17b0413c
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue