Comments (2)
Hi @DerLando! 😄
I'm happy to share the details of how I achieved the zoom functionality in blackjack, but unfortunately it requires a forked egui backend and it's not something that would be accepted upstream. Basically, it's a hack specific to the wgpu backend, and an ugly one at that: I have two separate egui instances, and render the second instance inside the first as a texture. This also means hijacking the winit integration and translating mouse events, plus adding a few transformations inside egui_wgpu to make sure clip rects are correct when sending them the GPU. On top of that, you need to mess with pixels_per_point at runtime, which can lead to performance issues.
This is why egui_node_graph doesn't support zoom while blackjack does. Because this is currently impossible to do without a very specific application architecture (2 separate egui instances, and a forked backend).
Egui needs a backend-independent mechanism for zooming, but I don't know enough about the egui internals to make that work. Nevertheless, I have reported this to the egui main repo and even volunteered for an implementation: With some guidance, and if someone tells me this has a chance of getting upstreamed, I'll gladly help. But so far things have been quiet.
It might help if you show your support there (even a thumbs up is okay) and expose your use case if you think that's relevant 👍
from egui_node_graph.
Thanks so much for the quick reply, I had a look at the linked feature request upstream and will add my voice.
I'll close this for now as it will likely require changes upstream.
from egui_node_graph.
Related Issues (20)
- Add topological iterator to Graph class HOT 1
- Easy way to create pre-existing graph state? HOT 1
- Performance concerns HOT 1
- give example the ability to zoom in/out and scroll side to side HOT 1
- missing input on Connection Only and then Connection/Constant node
- Handling disconnection events on node deletion is a bit cumbersome
- Persistence HOT 1
- Suggestion: Read-only mode
- Please add minimalistic example using bevy_egui HOT 11
- Buttons drawn on (after) the graph doesn't working. HOT 4
- The example doesn't work with version 0.3.0 HOT 3
- Would be nice with an example using Bevy and bevy-egui together with this project HOT 1
- Right click output - create node and connect HOT 1
- Incorrect draw order HOT 1
- Hide close button of node widget HOT 3
- New crates.io release HOT 1
- Cant Compile to web HOT 1
- Remove Widget on input connection HOT 1
- Cannot use because Color32 is not in epaint::color::Color32 HOT 4
- Feature request - allow labeling of edges HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egui_node_graph.