]> git.lyx.org Git - features.git/commit
Work around bug in QTextLine::xToCursor
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 31 Mar 2017 14:56:06 +0000 (16:56 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 31 Mar 2017 14:56:06 +0000 (16:56 +0200)
commitda590925cd6749587b9f500ecdaa457e34bc0f4a
treefd21434f3a27053d62c63cb037b796f2dfc920dd
parentdb7054da9f56d2dc574299e42370cc8cb53cf67a
Work around bug in QTextLine::xToCursor

With RtL text, the method can be non-monotonic wrt x value (which is a
Qt bug). To work around this, we check whether positions adjacent to
those returned by xToCursor look better. Depending on whether the new
x position is too small or too large, we look backward or forward for
a better solution.

The performance is probably not great, but this is only needed for
user interactions, so the performance penalty should not be a problem.

Fixes #10569.
src/frontends/qt4/GuiFontMetrics.cpp