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

Make EditorSpinSlider wait for idle_frame to update text on key_up/down #54288

Merged
merged 1 commit into from
Oct 31, 2021

Conversation

Razoric480
Copy link
Contributor

Fixes #54287. This ensures that the text is up to date with any setters that may modify the value.

@@ -424,6 +426,14 @@ void EditorSpinSlider::_notification(int p_what) {
_update_value_input_stylebox();
break;

case NOTIFICATION_PROCESS:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process is not the right way to implement the dirty flag pattern, a call_deferred() call would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did try call_deferred(), and it was unfortunately still too early. By the time the deferred call to the function happened, an idle frame still hadn't happened and the setter hadn't been called yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it should at least use NOTIFICATION_INTERNAL_PROCESS so that it doesn't conflict with user-defined set_process() calls.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot about that! Issued a fix.

@Calinou Calinou added this to the 4.0 milestone Oct 26, 2021
@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Oct 26, 2021
@akien-mga akien-mga merged commit 0b667e6 into godotengine:master Oct 31, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 15, 2021
@Razoric480 Razoric480 deleted the fix-key-up-down-idle-frame branch November 30, 2021 17:45
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.

Changing EditorSpinSlider values with arrow keys does not respect tool script setters
3 participants