]> git.lyx.org Git - lyx.git/commitdiff
Fix bold-like characters when selecting bidi text
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 9 Apr 2019 09:29:20 +0000 (11:29 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 10 Apr 2019 12:19:18 +0000 (14:19 +0200)
In painter, restrting paining regions does not really work when region is empty.

Fixes bug #11198.

(cherry picked from commit f9da28428a75f3e60920ec983ff52bbbf2e6d683)

src/frontends/qt4/GuiPainter.cpp
status.23x

index b0b1ec1f6f10290098947d7c1a622e25d3d734fb..c635c6f827b679e4c0b4df69421b80b78f4f2c34 100644 (file)
@@ -489,7 +489,11 @@ void GuiPainter::text(int x, int y, docstring const & str, Font const & f,
        int const height = fm.maxAscent() + fm.maxDescent();
        int xmin = fm.pos2x(str, from, dir == RtL, wordspacing);
        int xmax = fm.pos2x(str, to, dir == RtL, wordspacing);
-       if (xmin > xmax)
+       // Avoid this case, since it would make the `other' text spill in some cases
+       if (xmin == xmax) {
+               text(x, y, str, fi, dir, wordspacing, tw);
+               return;
+       } else if (xmin > xmax)
                swap(xmin, xmax);
 
        // First the part in other color
index bd7053e2d03299bf423ee0797fffcdd8ce095d40..5814ac915c36fe9db6b0676b041b68b8ae077829 100644 (file)
@@ -184,6 +184,8 @@ What's new
 
 - Fix left/right border UI when toggling formal table style (bug 9835).
 
+- Fix bold-like characters when selecting bidi text (bug 11198).
+
 
 * INTERNALS