GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
7.29k stars 385 forks source link

Connector input index skips hidden inputs #1765

Closed adamgerhant closed 3 weeks ago

adamgerhant commented 1 month ago

When disconnecting an input, the input index is determined by finding the index clicked connector from all visible connectors. This means that hidden inputs are not accounted for, and hiding an input shifts the index of all inputs below up by one. For example, when the "Dimensions" input is exposed but the "Location" is hidden for the Artboard node, it is impossible to disconnect the "Dimensions" input. Another example is when trying to disconnect the combine/split channel nodes. To solve this the index of input could be added to FrontendGraphInput, and it would be stored it as a data attribute on the port.

Another important consideration is that the index when connecting is correctly determined, its only broken when disconnecting.

adamgerhant commented 4 weeks ago

Solved by creating a function to get the actual input index from the visible input index