Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/main/java/org/fxmisc/flowless/Navigator.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ public void setTargetPosition(TargetPosition targetPosition) {
* and re-lays out the viewport
*/
public void scrollCurrentPositionBy(double delta) {
targetPosition = currentPosition.scrollBy(delta);
// delta needs rounding otherwise thin lines appear between cells,
// notably when scrolling with a mouse or using a scroll bar and
// usually only visible when cells have dark backgrounds/borders.
targetPosition = currentPosition.scrollBy(Math.round(delta));
requestLayout();
}

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/org/fxmisc/flowless/VirtualizedScrollPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,17 @@ private void setHPosition(double pos) {
pos,
content.getLayoutBounds().getWidth(),
content.totalWidthEstimateProperty().getValue());
content.estimatedScrollXProperty().setValue(offset);
content.estimatedScrollXProperty().setValue((double) Math.round(offset));
}

private void setVPosition(double pos) {
double offset = scrollbarPositionToOffset(
pos,
content.getLayoutBounds().getHeight(),
content.totalHeightEstimateProperty().getValue());
content.estimatedScrollYProperty().setValue(offset);
// offset needs rounding otherwise thin lines appear between cells,
// usually only visible when cells have dark backgrounds/borders.
content.estimatedScrollYProperty().setValue((double) Math.round(offset));
}

private static void setupUnitIncrement(ScrollBar bar) {
Expand Down