Too much space between emphasized f and caret (cursor)

Enrico Forestieri forenr at lyx.org
Thu Aug 6 13:44:31 UTC 2020


On Wed, Aug 05, 2020 at 06:14:16PM +0200, Daniel wrote:
> On 2020-08-05 15:15, Enrico Forestieri wrote:
> > On Wed, Aug 05, 2020 at 09:50:48AM +0200, Daniel wrote:
> > 
> > > I noticed that the caret is differently placed after some characters. For
> > > example, this gives the impression that there is a space between an
> > > emphasized f and the caret, see attached screen capture. Previous versions
> > > of LyX did not show this. I consider this a regression. The selection
> > > highlight (blue rectangle) is also wider.
> > 
> > This occurs only when a single character is inside the note inset and is
> > probably due to a thinko that is fixed by the attached patch.
> > 
> > Note that a similar patch is needed in stable after 79998fdc.
> > 
> > 
> Thanks. I tried your patch and it seems to have the expected effect. Might
> be worth committing?

Committed at 582296d7.

Riki, the corresponding patch for stable is attached.

-- 
Enrico
-------------- next part --------------
diff --git a/src/frontends/qt4/GuiFontMetrics.cpp b/src/frontends/qt4/GuiFontMetrics.cpp
index 02c5054094..9ad6c175b6 100644
--- a/src/frontends/qt4/GuiFontMetrics.cpp
+++ b/src/frontends/qt4/GuiFontMetrics.cpp
@@ -218,7 +218,7 @@ int GuiFontMetrics::width(docstring const & s) const
 	int w = 0;
 	if (s.length() == 1
 #if QT_VERSION >= 0x040800
-	    || font_.styleName() == "LyX"
+	    && font_.styleName() == "LyX"
 #endif
 	    ) {
 		// keep value 0 for math chars with null width


More information about the lyx-devel mailing list