]> git.lyx.org Git - lyx.git/blobdiff - src/bufferview_funcs.cpp
RTL bugfix: inside texted, use ParagraphMetrics::insetDimension() instead of Inset...
[lyx.git] / src / bufferview_funcs.cpp
index d777ac725bec25555374af1987c2ab87782eeca5..3f132de962d585d3c1366832038f27a22a5988cc 100644 (file)
@@ -178,11 +178,16 @@ Point coordOffset(BufferView const & bv, DocIterator const & dit,
                        bool rtl = bv.textMetrics(sl.text()).isRTL(sl, boundary_i);
                        if (rtl)
                                x -= lastw;
+                       // remember width for the case that sl.inset() is positioned in an RTL inset
+                       Dimension const & dim = bv.parMetrics(sl.text(), sl.pit()).
+                               insetDimension(&sl.inset());
+                       lastw = dim.wid;
+               } else {
+                       // remember width for the case that sl.inset() is positioned in an RTL inset
+                       Dimension const dim = sl.inset().dimension(bv);
+                       lastw = dim.wid;
                }
                
-               // remember width for the case that sl.inset() is positioned in an RTL inset
-               lastw = sl.inset().width();
-               
                //lyxerr << "Cursor::getPos, i: "
                // << i << " x: " << xx << " y: " << y << endl;
        }