Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Avoid wrapping to the 0th glyph variant when the 4th should be used

Julia9311e012718c
diff --git a/crates/gpui/src/platform/mac/sprite_cache.rs b/crates/gpui/src/platform/mac/sprite_cache.rs
index ceeb06698cf..2127d129603 100644
--- a/crates/gpui/src/platform/mac/sprite_cache.rs
+++ b/crates/gpui/src/platform/mac/sprite_cache.rs
@@ -90,11 +90,12 @@ impl SpriteCache {
let fonts = &self.fonts;
let atlases = &mut self.atlases;
let subpixel_variant = (
- (target_position.x().fract() * SUBPIXEL_VARIANTS as f32).round() as u8
+ (target_position.x().fract() * SUBPIXEL_VARIANTS as f32).floor() as u8
% SUBPIXEL_VARIANTS,
- (target_position.y().fract() * SUBPIXEL_VARIANTS as f32).round() as u8
+ (target_position.y().fract() * SUBPIXEL_VARIANTS as f32).floor() as u8
% SUBPIXEL_VARIANTS,
);
+
self.glyphs
.entry(GlyphDescriptor {
font_id,