Skip to content

Commit 1f32ed8

Browse files
authored
Fix thin lines between cells 2 (#106)
1 parent 2e14836 commit 1f32ed8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/org/fxmisc/flowless/VirtualizedScrollPane.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,17 @@ private void setHPosition(double pos) {
324324
pos,
325325
content.getLayoutBounds().getWidth(),
326326
content.totalWidthEstimateProperty().getValue());
327-
content.estimatedScrollXProperty().setValue(offset);
327+
content.estimatedScrollXProperty().setValue((double) Math.round(offset));
328328
}
329329

330330
private void setVPosition(double pos) {
331331
double offset = scrollbarPositionToOffset(
332332
pos,
333333
content.getLayoutBounds().getHeight(),
334334
content.totalHeightEstimateProperty().getValue());
335-
content.estimatedScrollYProperty().setValue(offset);
335+
// offset needs rounding otherwise thin lines appear between cells,
336+
// usually only visible when cells have dark backgrounds/borders.
337+
content.estimatedScrollYProperty().setValue((double) Math.round(offset));
336338
}
337339

338340
private static void setupUnitIncrement(ScrollBar bar) {

0 commit comments

Comments
 (0)