Skip to content

Commit

Permalink
Fixed ScaledVirtualized rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugen committed Oct 30, 2022
1 parent 39a8d37 commit 326b77c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/fxmisc/flowless/ScaledVirtualized.java
Expand Up @@ -17,8 +17,8 @@
* VirtualizedScrollPane<ScaledVirtualized> vsPane = new VirtualizedScrollPane(wrapper);
*
* // To scale actualContent without also scaling vsPane's scrollbars:
* wrapper.scaleProperty().setY(3);
* wrapper.scaleProperty().setX(2);
* wrapper.getZoom().setY(3);
* wrapper.getZoom().setX(2);
* }
* </pre>
*
Expand Down Expand Up @@ -51,13 +51,13 @@ public ScaledVirtualized(V content) {
);
estScrollX = Var.mapBidirectional(
content.estimatedScrollXProperty(),
scrollX -> scrollX * zoom.getX(),
scrollX -> scrollX / zoom.getX()
scrollX -> (double) Math.round( scrollX * zoom.getX() ),
scrollX -> (double) Math.round( scrollX / zoom.getX() )
);
estScrollY = Var.mapBidirectional(
content.estimatedScrollYProperty(),
scrollY -> scrollY * zoom.getY(),
scrollY -> scrollY / zoom.getY()
scrollY -> (double) Math.round( scrollY * zoom.getY() ),
scrollY -> (double) Math.round( scrollY / zoom.getY() )
);

zoom.xProperty() .addListener((obs, ov, nv) -> requestLayout());
Expand Down

0 comments on commit 326b77c

Please sign in to comment.