diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bcebe9fee8..153415d264f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project are documented in this file. - Fixed compiler panics when some complex expressions are used for the model expression in `for` (#2977) - Native style: Fixed support for floating point ranges in Slider. + - Fixed panics in the software renderer related to text rendering. ### Slint Language diff --git a/internal/core/software_renderer.rs b/internal/core/software_renderer.rs index a6d489af149..ff62e92876c 100644 --- a/internal/core/software_renderer.rs +++ b/internal/core/software_renderer.rs @@ -1376,7 +1376,7 @@ impl<'a, T: ProcessScene> SceneBuilder<'a, T> { if geometry.is_empty() { continue; } - let origin = (geometry.origin - offset.round()).cast::(); + let origin = (geometry.origin - offset.round()).round().cast::(); let actual_x = origin.x - src_rect.origin.x as usize; let actual_y = origin.y - src_rect.origin.y as usize; let stride = glyph.width.get() as u16;