Sliders: replace Into<f64> with AsPrimitive<f64>#3260
Sliders: replace Into<f64> with AsPrimitive<f64>#3260tritoke wants to merge 2 commits intoiced-rs:masterfrom
Conversation
This change is intended to allow the Slider and VerticalSlider structs to work with larger integer types such as u64 and usize.
4fe0960 to
b1eeaed
Compare
|
Although on second thought, I'm not sure we want to pretend that |
Yeah this was a thought I had as well, I think it might be worth mentioning in the docs that it uses conversions to/from f64 internally so it can represent up to 52(iirc) bits losslessly and the rest is imprecise? From what I can tell if you have multiple ways to control the same value the slider will not overwrite it's value if you have another way to change it. In my case I have a +/- 1 button and. a text entry box which is based on the true value. I'm not around tonight but I'm happy to add this to the relevant docs if you think it's a good idea. |
This change is intended to allow the Slider and VerticalSlider structs to work with larger integer types such as u64 and usize.
I had a use case for this on a personal project and @edwloef suggested the change on the discord so I've put up this PR for it.