Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix focus shortcut when in the bezier curve editor #94054

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

mihe
Copy link
Contributor

@mihe mihe commented Jul 7, 2024

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:

if (selection.is_empty()) {
for (int i = 0; i < edit_points.size(); ++i) {
IntPair key_pair = IntPair(edit_points[i].track, edit_points[i].key);
focused_keys.insert(key_pair);
}
} else {

The problem was that when the view box for the focus was calculated, it was still relying on the selection set rather than the focused_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.

@akien-mga akien-mga added this to the 4.3 milestone Jul 8, 2024
@akien-mga akien-mga merged commit 50db553 into godotengine:master Jul 8, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@mihe mihe deleted the fix-bezier-focus branch July 8, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants