[LyX/master] Make sure that caret width is not null in mathed

Jean-Marc Lasgouttes lasgouttes at lyx.org
Sun Sep 24 09:54:19 UTC 2023


commit 9156712895d20e337ca83b7b419aeae1b871cd2c
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Fri Sep 22 17:44:12 2023 +0200

    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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp
index d3ce3a3..a925119 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);


More information about the lyx-cvs mailing list