Skip to content

🚧 Why not use a Flickable as a Navigable (in order to have a bounding box behavior for the canvas) #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emmenlau opened this issue Jul 23, 2024 · 2 comments

Comments

@emmenlau
Copy link
Contributor

There is something that I'm missing in QuickQanava: The Navigable canvas allows to zoom and pan in such a way that none of the graph nodes remain visible (empty space). For me, that is not such a good behavior. I would prefer if zooming and panning is only allowed in such a way that there is not too much empty space visible.

More concretely, that means:

  • If the graph has a bounding box B, then lets call Bp the bounding box plus some offset (like 10% extra padding)
  • Do not allow to zoom out more than to make Bp fully visible
  • Do not allow to pan outside of Bp

I think that is the default behavior of a Flickable, if I'm not mistaken? Could the Navigable be replaced with Flickable to get a similar behavior, but with some of the extra nice zooming and panning behavior of Qt default?

@cneben
Copy link
Owner

cneben commented Aug 11, 2024

Hi @emmenlau I actually tried to implement a "zoom on mouse wheel in/out" with Fickable with early Qt5 version and never succeed to get it working, hence the custom qan::Navigable implementation.

It would be especially nice for touch and scrollbar support. I won't have time in the next weeks to have a try, but can review a PR ! This feature would be extremely nice and is a P1 on my side...

cneben added a commit that referenced this issue Aug 18, 2024
cneben added a commit that referenced this issue Aug 18, 2024
@cneben cneben changed the title Why not use a Flickable as a Navigable (in order to have a bounding box behavior for the canvas) 🚧 Why not use a Flickable as a Navigable (in order to have a bounding box behavior for the canvas) Aug 18, 2024
cneben added a commit that referenced this issue Aug 18, 2024
cneben added a commit that referenced this issue Aug 18, 2024
Signed-off-by: cneben <[email protected]>
cneben added a commit that referenced this issue Aug 19, 2024
Signed-off-by: cneben <[email protected]>
@cneben
Copy link
Owner

cneben commented Aug 19, 2024

@emmenlau Again, I did not succeed to make it works. I will borrow some concepts for Navigable, closing for #244.

For records: There is a working implementation of Flickable "zoom on point with mousewheel" in this branch GraphView.qml. Graph size management en centering is not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants