From: Jürgen Spitzmüller Date: Fri, 25 Jun 2010 14:07:55 +0000 (+0000) Subject: * TextMetrics.cpp: fix metrics calculation with preceeding blank in free spacing... X-Git-Tag: 2.0.0~3097 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0a137e315ab0534aaca8da72bdd4a80ca3e58f7f;p=features.git * TextMetrics.cpp: fix metrics calculation with preceeding blank in free spacing context (bug #6746) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34705 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 566617b4b5..675f8ee11a 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -1219,10 +1219,18 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit, return 0; } - // if the first character is a separator, we are in RTL - // text. This character will not be painted on screen + // This (rtl_support test) is not needed, but gives + // some speedup if rtl_support == false + bool const lastrow = lyxrc.rtl_support && row.endpos() == par.size(); + + // If lastrow is false, we don't need to compute + // the value of rtl. + bool const rtl = lastrow ? text_->isRTL(par) : false; + + // 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 (par.isSeparator(bidi.vis2log(vc))) + if (rtl && par.isSeparator(bidi.vis2log(vc))) ++vc; while (vc < end && tmpx <= x) { @@ -1250,13 +1258,7 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit, LASSERT(vc <= end, /**/); // This shouldn't happen. boundary = false; - // This (rtl_support test) is not needed, but gives - // some speedup if rtl_support == false - bool const lastrow = lyxrc.rtl_support && row.endpos() == par.size(); - // If lastrow is false, we don't need to compute - // the value of rtl. - bool const rtl = lastrow ? text_->isRTL(par) : false; if (lastrow && ((rtl && left_side && vc == row.pos() && x < tmpx - 5) || (!rtl && !left_side && vc == end && x > tmpx + 5))) {