ogallagher / fxgraph

A JavaFX graph editor
Do What The F*ck You Want To Public License
2 stars 0 forks source link

BasicGraphDemo zoom scroll not centered on cursor #3

Open ogallagher opened 2 years ago

ogallagher commented 2 years ago

The zoom scrolling doesn’t quite change the scale relative to the cursor location; it looks like something should be changed here:

https://github.com/ogallagher/fxgraph/blob/4643e37e5b4ff04c54180f2e20ce60073e57e9be/src/main/java/com/fxgraph/graph/ViewportGestures.java#L102-L143

ogallagher commented 2 years ago

This video illustrates the zoom origin issue:

https://user-images.githubusercontent.com/17031438/129513153-9cbb41ba-97f7-4709-a2fa-140fdaa3a0a7.mp4

ogallagher commented 2 years ago

I imagine it might make sense to completely overhaul the viewport and node transforms with usage of AffineTransform concatenation, but this could also be too drastic of a change.