Nelarius / imnodes

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

PushStyleVar(ImNodesStyleVar_LinkThickness, ...) doesn't work. #153

Open simonwinkelbach opened 2 years ago

simonwinkelbach commented 2 years ago

I want to increase the line thickness of individual links, while keeping the default thickness of all others.

PushStyleVar(ImNodesStyleVar_LinkThickness, 5);
Link(...);
PopStyleVar();

doesn't change the thickness, whereas

PushColorStyle(ImNodesCol_Link, IM_COL32(255, 255, 255, 255));
Link(...);
PopColorStyle();

changes the color as expected.

Great project BTW. Very clean and easy to use. Thanks!!

MarcusMadland commented 2 years ago

Make sure you call the PushStyleVar before ImNodes::BeginNodeEditor();

simonwinkelbach commented 2 years ago

Make sure you call the PushStyleVar before ImNodes::BeginNodeEditor();

Thanks for the hint. This changes the thickness of all links, but as I said, I want to change thickness of just some links and not all. In our application, some nodes perform long-running tasks, therefore their output attributes are invalid at start and gets valid after a while. The idea is to emphasize links that have “valid” data by increasing their thickness.

Nelarius commented 2 years ago

Hi @simonwinkelbach ! Indeed, it looks like we only capture the active color settings for each link, not the thickness. I just opened a massive pr which touches links, and I think this issue will be easy to fix after that is merged 🙂

simonwinkelbach commented 2 years ago

@Nelarius Sounds great! Thanks for your support!

simonwinkelbach commented 1 year ago

I couldn't wait to fix this issue by myself, which wasn't a big deal. Here is the pull request: https://github.com/Nelarius/imnodes/pull/172

simonwinkelbach commented 1 year ago

@Nelarius is this project still alive? Would be a shame if not! I volunteer to help :-)