X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathRow.cpp;h=81b6ad9e9218cc406dfbae1521a4389f7b205951;hb=ffff88e7fcd46afaa3b1823e9fcdc4aad4e2114b;hp=b8a9a9518b5ba404d93bc7b38f7ab02542ccd6fa;hpb=9cb98136ceeb3fbda70aa5beea4cf3f5ea26a36c;p=features.git diff --git a/src/mathed/MathRow.cpp b/src/mathed/MathRow.cpp index b8a9a9518b..81b6ad9e92 100644 --- a/src/mathed/MathRow.cpp +++ b/src/mathed/MathRow.cpp @@ -322,18 +322,16 @@ void MathRow::draw(PainterInfo & pi, int x, int const y) const // This is hackish: the math inset does not know that space // has been added before and after it; we alter its dimension // while it is drawing, because it relies on this value. - Dimension const d = coords.insets().dim(e.inset); - Dimension d2 = d; - d2.wid -= e.before + e.after; - coords.insets().add(e.inset, d2); + Geometry & g = coords.insets().geometry(e.inset); + g.dim.wid -= e.before + e.after; if (pi.pain.develMode() && !e.inset->isBufferValid()) - pi.pain.fillRectangle(x + e.before, y - d2.ascent(), - d2.width(), d2.height(), Color_error); + pi.pain.fillRectangle(x + e.before, y - g.dim.ascent(), + g.dim.width(), g.dim.height(), Color_error); e.inset->draw(pi, x + e.before, y); - coords.insets().add(e.inset, x, y); - coords.insets().add(e.inset, d); + g.pos = {x, y}; + g.dim.wid += e.before + e.after; drawMarkers(pi, e, x, y); - x += d.wid; + x += g.dim.wid; break; } case BEGIN: