Fix #95855: prioritize selecting keys on active fcurve #107223

Merged
Nathan Vegdahl merged 6 commits from nathanvegdahl/blender:overlapping_key_selection into main 2023-05-04 10:10:41 +02:00

6 Commits

Author SHA1 Message Date
Nathan Vegdahl b8c5ee028f Cleanup: small refactor of `get_best_nearest_fcurve_vert()` 2023-04-26 11:11:06 +02:00
Nathan Vegdahl bd6249f6b0 Cleanup: improve code comments. 2023-04-26 10:44:17 +02:00
Nathan Vegdahl 5336ce2cd0 Cleanup: switch to LISTBASE_FOREACH and other cosmetic changes 2023-04-26 10:17:12 +02:00
Nathan Vegdahl 091d3508f5 Graph Editor: make selection account for individual handle status
This is a bit subtle.  Prior to this commit, all handles on a key
would be considered "selected" when determining what to select next,
even if only a single handle was selected.

For example, consider two keys, A and B, with main vertices very
close to each other, and with only the left bezier handle of A being
selected.  If the user then clicked on the main vertex of A, the
selection code would consider A already selected and thus select
B instead, despite the main vertex of A not being selected.  This
was a really weird behavior, and made it impossible to select the
main vertex of A in such situations.

This commit fixes that by properly considering the selection status
of each handle/vertex of a key individually.
2023-04-25 11:54:41 +02:00
Nathan Vegdahl 3a417b467c Cleanup: add explicit null pointer check
Not functionally necessary in this case, but it makes the intent
more obvious and makes the code more resilient to future changes.
2023-04-24 13:04:32 +02:00
Nathan Vegdahl fd86c286e4 Fix #95855: prioritize selecting keys on active fcurve 2023-04-21 18:48:05 +02:00