Nelarius / imnodes

A small, dependency-free node editor for dear imgui
MIT License
1.97k stars 241 forks source link

Change mini-map behavior to work as described in issue #117 #121

Closed smilediver closed 2 years ago

smilediver commented 2 years ago

Change mini-map behavior to work as described in issue #117

Mini-map changes:

Color node editor example changes:

Internal changes:

NOTE: This is based on top of PR #120, so probably that one should go in first.

Auburn commented 2 years ago

This is great!

A few things I noticed trying it out:

smilediver commented 2 years ago
  • There needs to be ImNodesStyleVar enum entries for the new minimap style items
  • I think the default minimap padding could be a bit larger, 8 seems like a nice value

Will add.

  • It would be nice to have the old functionality as an option still

I'm not sure it's worth it. Mini-map's purpose is quick overview and navigation around a large graph, and IMHO, this behavior achieves it much better than the old one. I think it would be better to add zooming to the main editor view (I'm willing to look into it), which would make the old mini-map's behavior even more obsolete.

Auburn commented 2 years ago

I've changed my mind, I can't see any use case where you'd want the old functionality

smilediver commented 2 years ago

Oops, deleted the branch by accident. Sorry about that. 😊

The content-rectangle based minimap port is a nice touch. However, it can get quite elongated (at least in my contrived example shown here 😄 ). Do you think this is desired behavior? It could make the Minimap a bit difficult to see visually, if the user has very wide or tall node graphs.

Yeah, it looks weird, but long graphs will always look weird, it's an unsolvable problem. I could add a limit to the aspect ratio, so that the mini-map doesn't get so thin though, maybe that would improve the situation a bit.

Nelarius commented 2 years ago

As per Auburn's comment, let's not keep the old functionality 🙂