(&mut self, bounds_min: DVec2, bounds_max: DVec2, padding_frac: f64)
| 150 | } |
| 151 | |
| 152 | pub(crate) fn set_bounds(&mut self, bounds_min: DVec2, bounds_max: DVec2, padding_frac: f64) { |
| 153 | let size = (bounds_max - bounds_min).max(DVec2::splat(EPSILON_SMALL)); |
| 154 | let size_padded = size + size * padding_frac; |
| 155 | self.half_extents = size_padded / 2.0; |
| 156 | let center = (bounds_min + bounds_max) / 2.0; |
| 157 | self.position = center; |
| 158 | // Set render_offset to center for high-precision rendering near zero |
| 159 | self.render_offset = center; |
| 160 | } |
| 161 | } |