Small tweak — Better list reordering (inserting vs swapping)

NodeCanvas Forums General Discussion Small tweak — Better list reordering (inserting vs swapping)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13101
    birdinthecity
    Participant

    Small “fix” to improve the reorderable list functionality (such as Variable list).

    Currently, variable lists are reordered by swapping positions. So if you’re trying to drag a variable from bottom of list to top, the previous top item moves to the bottom. This doesn’t make sense.

    Instead, the item you’re moving should be inserted into the list at a given position. No swapping necessary. This change makes maintaining an orderly list much more straightforward.

    This is a very small fix in EditorUtils_ReorderableList.cs lines 134-143:
    Relevant code change: 138-139.

    #13125
    Gavalakis
    Keymaster

    Hey,

    Indeed that is something that slipped by and the Reorderable List has already been fixed for the next hotfix version, pretty much exactly in the way you posted here 🙂

    Thank you!

    Join us on Discord: https://discord.gg/97q2Rjh

    #13332
    bcristian
    Participant

    I was just about to post about this issue when I thought to search first.
    I’ve made the following change, which does the same thing but faster:

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.