From 9156712895d20e337ca83b7b419aeae1b871cd2c Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 22 Sep 2023 17:44:12 +0200 Subject: [PATCH] Make sure that caret width is not null in mathed The same test exists in texted. Fixes bug #12904. --- src/mathed/MathData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index d3ce3a31c8..a92511919a 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -298,7 +298,7 @@ void MathData::metrics(MetricsInfo & mi, Dimension & dim, bool tight) const // so that we can set the caret vertical dimensions. mrow.caret_dim.asc = min(dim.asc, fm.maxAscent()); mrow.caret_dim.des = min(dim.des, fm.maxDescent()); - mrow.caret_dim.wid = fm.lineWidth(); + mrow.caret_dim.wid = max(fm.lineWidth(), 1); /// do the same for math cells linearized in the row MathRow caret_row = MathRow(mrow.caret_dim);