DVUI

max_float_safe

Used as a default maximum in various places:

  • Options.max_size_content
  • Font.textSizeEx max_width

This is a compromise between desires:

  • gives a decent range
  • is a normal number (not nan/inf) that works in normal math
  • can still have some extra added to it (like padding)
  • float precision in this range (0.125) is small enough so integer stuff still works

If positions/sizes are getting into this range, then likely something is going wrong.

Source

Implementation

#
pub const max_float_safe: f32 = 2_000_000