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 clamping logic in EditorSpinSlider #81278

Merged

Conversation

Alex2782
Copy link
Contributor

@Alex2782 Alex2782 commented Sep 3, 2023

... when arrow keys are pressed up or down.

Fixes #81272

I have only tried Inspertor, I am not sure if the old changes are necessary for something else.
The old version changed the values by 0.001 from time to time.

Screen-2023-09-03-200319.mp4

@AThousandShips AThousandShips changed the title Fixes the 'CLAMP' problem in the 'EditorSpinSlider' ... Fixes the 'CLAMP' problem in EditorSpinSlider ... Sep 3, 2023
... when arrow keys are pressed up or down.
@Alex2782 Alex2782 force-pushed the bugfix_EditorSpinSlider_clamp#81272 branch from 33cc232 to 053d718 Compare September 3, 2023 18:48
@MewPurPur
Copy link
Contributor

MewPurPur commented Sep 3, 2023

I already did this in #80551. I think I did it better; I have a few doubts about how it's implemented here but I'll have to test them out.

@Alex2782
Copy link
Contributor Author

Alex2782 commented Sep 3, 2023

ok, I would also like to catch mouse wheel events. e.g. Ctrl + up/down does not work under MacOS, already assigned with the system function Show all windows of the front app. But mainly to increase the usability, if it is possible directly when the mouse is over the input field, without 'input focus'.

Should I wait until 'merge' has been executed? #80551

@MewPurPur
Copy link
Contributor

MewPurPur commented Sep 3, 2023

Would suggest against it. Would lead to a lot of accidental value changes when one tries to adjust their inspector view.

@MewPurPur
Copy link
Contributor

Nevermind, this PR works well in all situations, I think it's better than mine actually. So my PR can be closed, though I think my comments can be carried over to improve the clarity of the code.

// Modifiers based on web browsers' DevTools. before the Ctrl/Alt/Shift modifier code.

// If the step is smaller than 1 but can be expressed as a 1/int fraction, then set the change to 1.
// For example, 0.001 is 1/1000, so then the change will be 1.
// Otherwise, for example if the step is 0.4, use that step directly. before the step declaration.

@YuriSizov YuriSizov modified the milestones: 4.x, 4.2 Sep 4, 2023
@YuriSizov YuriSizov changed the title Fixes the 'CLAMP' problem in EditorSpinSlider ... Fix clamping logic in EditorSpinSlider Sep 4, 2023
@akien-mga akien-mga merged commit 480590c into godotengine:master Sep 26, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@Alex2782 Alex2782 deleted the bugfix_EditorSpinSlider_clamp#81272 branch September 26, 2023 11:19
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.

EditorSpinSlider: Change input via ´down´ or ´up´ arrow key
5 participants