Fix focus shortcut when in the bezier curve editor #94054
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was about to make a proposal for adding the ability to focus (by pressing the "F" key) on all the bezier keys in the bezier curve animation editor when no keys are selected, only to find that this seems to have been the intention all along, as seen here:
godot/editor/animation_bezier_editor.cpp
Lines 940 to 945 in 42e5b3a
The problem was that when the view box for the focus was calculated, it was still relying on the
selection
set rather than thefocused_keys
set, which looks a lot like a bug.This PR fixes that by simply using the
focused_keys
set for calculating the view box instead.This would also explain the somewhat janky behavior when focusing while having only one key selected, which this
focused_keys
set takes into account by adding the neighboring keys to it. So I guess this PR fixes that too.