From f19c45494a51db73588fad16933c8be5e8078fe2 Mon Sep 17 00:00:00 2001 From: DKolter Date: Sun, 1 Jun 2025 12:45:05 +0200 Subject: [PATCH 1/2] fix: Wgpu text bounds cutoff --- wgpu/src/text.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index f2908e71..d979b625 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -628,8 +628,8 @@ fn prepare( bounds: cryoglyph::TextBounds { left: clip_bounds.x as i32, top: clip_bounds.y as i32, - right: (clip_bounds.x + clip_bounds.width) as i32, - bottom: (clip_bounds.y + clip_bounds.height) as i32, + right: (clip_bounds.x + clip_bounds.width).round() as i32, + bottom: (clip_bounds.y + clip_bounds.height).round() as i32, }, default_color: to_color(color), }) From dcf5abb0d8c724e68b916cd9dd17c37b26a3cb84 Mon Sep 17 00:00:00 2001 From: DKolter Date: Tue, 3 Jun 2025 12:17:26 +0200 Subject: [PATCH 2/2] Also add round to text bound position --- wgpu/src/text.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index d979b625..6fcc8e45 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -626,8 +626,8 @@ fn prepare( scale: transformation.scale_factor() * layer_transformation.scale_factor(), bounds: cryoglyph::TextBounds { - left: clip_bounds.x as i32, - top: clip_bounds.y as i32, + left: clip_bounds.x.round() as i32, + top: clip_bounds.y.round() as i32, right: (clip_bounds.x + clip_bounds.width).round() as i32, bottom: (clip_bounds.y + clip_bounds.height).round() as i32, },