Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following #863 (comment), this moves
egui/util/float_ord.rs
->epaint/util/ordered_float.rs
and implementsHash
based onepaint::f32_hash()
.Open questions:
Currently,
f64::ord()
simply truncates tof32
, which may yield incorrect results for high precision floats. I see three solutions:OrderedFloat
generic on the float type. A bit more complex implementation, as we need to create traits to abstract overf32
andf64
foris_nan()
etc.f32
(status quo) -- not recommended, can cause really nasty bugsf64
-- safe, but might incur minor performance penaltyShould this be part of the public API?
I moved it to a different crate, so it can't be
pub(crate)
anymore. However, we can mark it#[doc(hidden)]
if it should stay an implementation detail.