pub fn snap_platform_view_bounds(
bounds: Bounds<Pixels>,
scale_factor: f32,
) -> Bounds<Pixels>Expand description
Rounds window-space bounds onto the display’s device-pixel grid, returning logical pixels again.
Native views are positioned in logical points, so honoring the scale factor means landing on the same grid the renderer rasterizes GPUI content to; otherwise a hosted view drifts by a fraction of a pixel against the GPUI content around it.