From d1658af8b9fa038a6a80195da40110993c492824 Mon Sep 17 00:00:00 2001 From: marc2332 Date: Sun, 29 Sep 2024 10:55:47 +0200 Subject: [PATCH] fix: Check the default text align for expanded texts --- crates/core/src/render/skia_measurer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/core/src/render/skia_measurer.rs b/crates/core/src/render/skia_measurer.rs index a3278bc04..d79d347cc 100644 --- a/crates/core/src/render/skia_measurer.rs +++ b/crates/core/src/render/skia_measurer.rs @@ -156,7 +156,7 @@ pub fn create_label( let mut paragraph = paragraph_builder.build(); paragraph.layout( - if font_style.max_lines == Some(1) && font_style.text_align == TextAlign::Start { + if font_style.max_lines == Some(1) && font_style.text_align == TextAlign::default() { f32::MAX } else { area_size.width + 1.0 @@ -263,7 +263,7 @@ pub fn create_paragraph( let mut paragraph = paragraph_builder.build(); paragraph.layout( - if font_style.max_lines == Some(1) && font_style.text_align == TextAlign::Start { + if font_style.max_lines == Some(1) && font_style.text_align == TextAlign::default() { f32::MAX } else { area_size.width + 1.0