Currently any Duration that's in an Inspectable struct (like a Component or Resource) gets rounded off to the closest f32 seconds representation every frame. This breaks logic that adds small Duration values with large ones. For example, in my game I have an age field in a resource that can increase to very large amounts (years) when fast-forwarding but then need to increase by small amounts (milliseconds) when going in slow-motion. Without this fix, the age field never increases because bevy-inspector-egui rounds it off.
I'm not sure if f64 is able to capture enough precision to prevent the specific corner case I ran into in my game, but either way it seems that any lossy or imprecise conversion should only set the value when changed manually by the user.
Currently any
Duration
that's in anInspectable
struct (like aComponent
orResource
) gets rounded off to the closest f32 seconds representation every frame. This breaks logic that adds smallDuration
values with large ones. For example, in my game I have anage
field in a resource that can increase to very large amounts (years) when fast-forwarding but then need to increase by small amounts (milliseconds) when going in slow-motion. Without this fix, theage
field never increases becausebevy-inspector-egui
rounds it off.I'm not sure if
f64
is able to capture enough precision to prevent the specific corner case I ran into in my game, but either way it seems that any lossy or imprecise conversion should only set the value when changed manually by the user.