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

Add floating point value box to raygui #356

Merged
merged 8 commits into from
May 7, 2024
Merged

Conversation

benjibst
Copy link
Contributor

No description provided.

@raysan5
Copy link
Owner

raysan5 commented Jan 2, 2024

@benjibst this is a breaking change for raygui because it requires a new function from raylib, not merging it for now but I keep the PR open while thinking what should be done with it...

@benjibst
Copy link
Contributor Author

benjibst commented Jan 3, 2024

@raysan5 ah ok, got it, maybe one solution could be to just use the c standard library?

@raysan5
Copy link
Owner

raysan5 commented Jan 3, 2024

maybe one solution could be to just use the c standard library?

Yeap, probably that's the best solution at this point.

src/raygui.h Show resolved Hide resolved
@raysan5
Copy link
Owner

raysan5 commented May 7, 2024

@benjibst What is the state of this PR? Is it possible to move val_str to a static variable inside the control? It can be updated on editMode and just reseted on exiting editMode. Afaik, in most use cases there won't be two floats being edited at the same time.

@benjibst
Copy link
Contributor Author

benjibst commented May 7, 2024

@raysan5 last time i tried to implement this with a static text buffer, but the problem is that when you edit the value of one textbox, and then switch to the other textbox, the float value in the text buffer is shared so the value of the second textbox gets overwritten

@raysan5
Copy link
Owner

raysan5 commented May 7, 2024

@benjibst I see the issue now. It happens when switching from one text box to another directly without exiting the first one "properly" so it's like two text boxes are active for one frame... mmmh... thinking if it can be addressed in some way...

@raysan5
Copy link
Owner

raysan5 commented May 7, 2024

@benjibst I'm merging this PR and I'll try to find some solution in the meantime... Thanks again for all the work you put on this improvement! :)

@raysan5 raysan5 merged commit a717c69 into raysan5:master May 7, 2024
@benjibst
Copy link
Contributor Author

benjibst commented May 7, 2024 via email

@raysan5
Copy link
Owner

raysan5 commented May 7, 2024

@benjibst Yes, that's my idea but I'm not sure if it would work... As per my understanding, at the moment it fails because when you "jump" from one GuiValueBox to another, the state logic for editMode keeps executing without an exit logic... but I could be wrong... it needs to be tested...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants