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;
}
// FIXME: This does not work within mathed!
CurStatus status(BufferView const * bv, DocIterator const & dit)
{
+ // FIXME: it's be better to have something like TextMetrics::status().
TextMetrics const & tm = bv->textMetrics(dit.bottom().text());
- if (tm.has(dit.bottom().pit()))
- return CUR_INSIDE;
- else if (dit.bottom().pit() < bv->anchor_ref())
+ int par_pos = tm.parPosition(dit.bottom().pit());
+ if (par_pos < 0)
return CUR_ABOVE;
- else
+ else if (par_pos > bv->workHeight())
return CUR_BELOW;
+
+ return CUR_INSIDE;
}
namespace {
if (inset
&& find(codes.begin(), codes.end(), inset->lyxCode()) != codes.end()
&& (contents.empty() ||
- static_cast<InsetCommand const *>(inset)->getContents() == contents)) {
+ static_cast<InsetCommand const *>(inset)->getContents() == contents)) {
dit = tmpdit;
return true;
}