diff --git a/core/src/text.rs b/core/src/text.rs index fc8aa20ee2..7afdb75bc3 100644 --- a/core/src/text.rs +++ b/core/src/text.rs @@ -74,7 +74,9 @@ impl LineHeight { /// Returns the [`LineHeight`] in absolute logical pixels. pub fn to_absolute(self, text_size: Pixels) -> Pixels { match self { - Self::Relative(factor) => Pixels(factor * text_size.0), + Self::Relative(factor) => { + Pixels((factor * text_size.0).max(f32::MIN_POSITIVE)) + } Self::Absolute(pixels) => pixels, } }