From adf2fec2e0f8e63fe6d9e365a09e44e6a87af6d7 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 15 Jan 2026 09:04:21 -0500 Subject: [PATCH] Revert "gpui: Add dynamic padding to prevent glyph clipping in text rendering on macOS (#45957)" (#46906) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 83ca31055cf3e56aa8a704ac49e1686434f4e640. This change produces bad clipping on macOS: Screenshot 2026-01-15 at 8 51 28 AM Screenshot 2026-01-15 at 8 51 35 AM Screenshot 2026-01-15 at 8 51 41 AM https://zed-industries.slack.com/archives/C04S5TU0RSN/p1768473926260279 Release Notes: - Reverted #45957 --- crates/gpui/src/platform/mac/text_system.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/crates/gpui/src/platform/mac/text_system.rs b/crates/gpui/src/platform/mac/text_system.rs index df0e1433e0e7cf53c9288b771aa44bcd68e03d68..c72271f24fe4ea3750e7aa1d18cadf786cac741e 100644 --- a/crates/gpui/src/platform/mac/text_system.rs +++ b/crates/gpui/src/platform/mac/text_system.rs @@ -356,22 +356,16 @@ impl MacTextSystemState { fn raster_bounds(&self, params: &RenderGlyphParams) -> Result> { let font = &self.fonts[params.font_id.0]; - let mut bounds: Bounds = font + let scale = Transform2F::from_scale(params.scale_factor); + Ok(font .raster_bounds( params.glyph_id.0, params.font_size.into(), - Transform2F::from_scale(params.scale_factor), + scale, HintingOptions::None, font_kit::canvas::RasterizationOptions::GrayscaleAa, )? - .into(); - - // Adjust the x position to account for the scale factor to avoid glyph clipped. - let x_offset = DevicePixels(bounds.origin.x.0 / params.scale_factor as i32); - bounds.origin.x -= x_offset; - bounds.size.width += x_offset; - - Ok(bounds) + .into()) } fn rasterize_glyph(