Skip to content

Commit

Permalink
Add TODO note about smooth scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
FeldrinH committed Sep 18, 2023
1 parent 245b6d8 commit 4fac7aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/ee/ut/dendroloj/GraphGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public void mouseWheelMoved(MouseWheelEvent event) {
event.consume();

// Zoom towards cursor with scroll wheel. Adapted from https://stackoverflow.com/a/52929241.
// Note: This is smooth on touchpad when scrolling with two fingers, but not when pinching.
// TODO: Figure out why. If possible make scrolling by pinching smooth as well.
double factor = Math.pow(ZOOM_FACTOR, event.getPreciseWheelRotation());
Camera cam = view.getCamera();
double zoom = cam.getViewPercent() * factor;
Expand Down

0 comments on commit 4fac7aa

Please sign in to comment.