From ab1fabef6806f3a41d9a629fd7e23942c1446a2c Mon Sep 17 00:00:00 2001 From: apricotbucket28 <71973804+apricotbucket28@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:43:23 -0300 Subject: [PATCH] gpui: Align SVG sprites to whole pixels (#15822) Related to https://github.com/zed-industries/zed/issues/12352 (and old issue https://github.com/zed-industries/zed/issues/643) This fixes visual glitches that could happen when rendering icons on Linux and Windows (and in the Blade backend) ![image](https://github.com/user-attachments/assets/02646d1d-d35b-48be-89c9-189416510cf2) ![image](https://github.com/user-attachments/assets/ccf99867-25d2-40fb-8735-c540f8cf793a) ![image](https://github.com/user-attachments/assets/8d1124a3-669e-4be5-8b46-5dc2df14a28a) Release Notes: - Linux: Fixed visual glitches when rendering icons. --- crates/gpui/src/window.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index 6be4126f3d..1cfbe0dbae 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -2597,7 +2597,9 @@ impl<'a> WindowContext<'a> { .insert_primitive(MonochromeSprite { order: 0, pad: 0, - bounds, + bounds: bounds + .map_origin(|origin| origin.floor()) + .map_size(|size| size.ceil()), content_mask, color, tile,