#include "support/textutils.h"
#include "support/convert.h"
+#include <boost/current_function.hpp>
+
#include <sstream>
using lyx::pit_type;
InsetList::iterator iend = par.insetlist.end();
for (; ii != iend; ++ii) {
Dimension dim;
- int const w = maxwidth_ - leftMargin(pit) - rightMargin(par);
+ int const w = maxwidth_ - leftMargin(pit, ii->pos) - rightMargin(par);
MetricsInfo mi(bv(), getFont(par, ii->pos), w);
ii->inset->metrics(mi, dim);
}
// see correction above
if (boundary_correction)
- if (getFont(par, ppos).isRightToLeft())
+ if (getFont(par, ppos).isVisibleRightToLeft())
x -= singleWidth(par, ppos);
else
x += singleWidth(par, ppos);
+ // Make sure inside an inset we always count from the left
+ // edge (bidi!) -- MV
+ if (sl.pos() < par.size()) {
+ font = getFont(par, sl.pos());
+ if (!boundary && font.isVisibleRightToLeft()
+ && par.isInset(sl.pos()))
+ x -= par.getInset(sl.pos())->width();
+ }
return int(x);
}