This is necessary when markers are nested. Ideally this should only be
done when there is risk of nesting.
Fixes (part of?) bug #10688.
int markerMargin(MathRow::Element const & e)
{
int markerMargin(MathRow::Element const & e)
{
- return e.marker == InsetMath::MARKER
- || e.marker == InsetMath::MARKER2;
+ switch(e.marker) {
+ case InsetMath::MARKER:
+ case InsetMath::MARKER2:
+ case InsetMath::BOX_MARKER:
+ return 2;
+ case InsetMath::NO_MARKER:
+ return 0;
+ }
+ // should not happen
+ return 0;
Dimension const dim = coords.getInsets().dim(e.inset);
// the marker is before/after the inset. Necessary space has been reserved already.
Dimension const dim = coords.getInsets().dim(e.inset);
// the marker is before/after the inset. Necessary space has been reserved already.
- int const l = x + e.before - markerMargin(e);
+ int const l = x + e.before - (markerMargin(e) > 0 ? 1 : 0);
int const r = x + dim.width() - e.after;
if (e.marker == InsetMath::BOX_MARKER) {
int const r = x + dim.width() - e.after;
if (e.marker == InsetMath::BOX_MARKER) {