]> git.lyx.org Git - features.git/blobdiff - src/insets/insettext.C
Patch from John (figinset) and Dekel (RTL and spellchecker)
[features.git] / src / insets / insettext.C
index 218521efbca3099c49124d38e9ab77fca011af5a..2d5f381ea49d296b8d43e21465bd0f7ffe737c1c 100644 (file)
@@ -1450,7 +1450,15 @@ LyXFont InsetText::GetDrawFont(BufferView * bv, LyXParagraph * p, int pos) const
 
 int InsetText::cx(BufferView * bv) const
 {
-    return TEXT(bv)->cursor.x() + top_x + TEXT_TO_INSET_OFFSET;
+       LyXText * text = TEXT(bv);
+       int x = text->cursor.x() + top_x + TEXT_TO_INSET_OFFSET;
+       if (the_locking_inset) {
+               LyXFont font = text->GetFont(bv->buffer(),
+                                    text->cursor.par(), text->cursor.pos());
+               if (font.isVisibleRightToLeft())
+                       x -= the_locking_inset->width(bv, font);
+       }
+       return x;
 }