]> git.lyx.org Git - features.git/commitdiff
Fix bug #7518: Assert when selecting in RTL text
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 29 Apr 2012 20:46:17 +0000 (22:46 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 29 Apr 2012 20:47:06 +0000 (22:47 +0200)
If we are in rtl text, we *need* to check whether the first character is a
space. We can't use the rtl variable for this because this is only
computed on the last row.

This bug was introduced in [0a137e31/lyxgit] to fix the computation for
freespacing paragraphs. We better can just check whether the paragraph is
freespacing or not.

src/TextMetrics.cpp

index 50f6062275a685b238031c94eb8c02cccc8bf8f5..6c32ee4dc6d19de91f3da3a6b8fb06cce8f26d05 100644 (file)
@@ -1235,8 +1235,9 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
 
        // if the first character is a separator, and we are in RTL
        // text, this character will not be painted on screen
-       // and thus we should not count it and skip to the next.
-       if (rtl && par.isSeparator(bidi.vis2log(vc)))
+       // and thus we should not count it and skip to the next. Only
+       // in freespacing paragraphs, this first character is painted.
+       if (!par.isFreeSpacing() && par.isSeparator(bidi.vis2log(vc)))
                ++vc;
 
        while (vc < end && tmpx <= x) {