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 default value for v_speed argument in DragScalar{N} #3922

Closed
wants to merge 1 commit into from

Conversation

eliasdaler
Copy link
Contributor

@eliasdaler eliasdaler commented Mar 16, 2021

This makes API consistent with typed Drag<T><N> widgets which allow to not specify v_speed manually

@eliasdaler
Copy link
Contributor Author

Another thing I've found is that a default format string for generic "float" type is "%f", while most functions default to "%.3f", which is nice. (right now I'm getting 6 decimals after the floating point when I use DragScalar, which is not nice)
Maybe it should get fixed here too?

@ocornut
Copy link
Owner

ocornut commented Mar 16, 2021

Thank you, merged.

Another thing I've found is that a default format string for generic "float" type is "%f", while most functions default to "%.3f", which is nice. (right now I'm getting 6 decimals after the floating point when I use DragScalar, which is not nice)
Maybe it should get fixed here too?

I think it would indeed be good to change this to "%.3f". It makes that DataType info array carry a little more responsibility than necessary but overall make things more consistent. Broken by 3e80874
I'll change it now.

@ocornut ocornut closed this Mar 16, 2021
ocornut added a commit that referenced this pull request Mar 16, 2021
…efault them to "%.3f" to be consistent with the compile-time default. (#3922)
@eliasdaler eliasdaler deleted the patch-1 branch March 16, 2021 13:37
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