]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBoxed.cpp
last commit was incomplete... not sure how I managed this..
[lyx.git] / src / mathed / InsetMathBoxed.cpp
index 9f2a7ed59180b8cf7c97ed5154fc63873a463681..d9e52c3e1fe4047178274676a162a9b474642870 100644 (file)
@@ -37,14 +37,16 @@ void InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        cell(0).metrics(mi, dim);
        metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space
-       dim_ = dim;
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
 }
 
 
 void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
 {
-       pi.pain.rectangle(x + 1, y - dim_.ascent() + 1,
-               dim_.width() - 2, dim_.height() - 2, Color::foreground);
+       Dimension const dim = dimension(*pi.base.bv);
+       pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
+               dim.width() - 2, dim.height() - 2, Color::foreground);
        cell(0).draw(pi, x + 3, y);
        setPosCache(pi, x, y);
 }