]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathDots.cpp
visual mode for bidi cursor movement
[lyx.git] / src / mathed / InsetMathDots.cpp
index e949df8fdddd4947654edf7b7422e33d3c51276d..6e54907653e4131cbd9d7011c458db55e69c7655 100644 (file)
 #include <config.h>
 
 #include "InsetMathDots.h"
+
 #include "MathStream.h"
 #include "MathSupport.h"
 #include "MathParser.h"
+#include "MetricsInfo.h"
 
 #include "frontends/FontMetrics.h"
 
@@ -32,7 +34,7 @@ Inset * InsetMathDots::clone() const
 }
 
 
-bool InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        dim = theFontMetrics(mi.base.font).dimension('M');
        dh_ = 0;
@@ -47,22 +49,19 @@ bool InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const
        }
        else if (key_->name == "ddots")
                dh_ = dim.asc;
-       if (dim_ == dim)
-               return false;
-       dim_ = dim;
-       return true;
 }
 
 
 void InsetMathDots::draw(PainterInfo & pain, int x, int y) const
 {
-       mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(),
+       Dimension const dim = dimension(*pain.base.bv);
+       mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(),
                key_->name);
        if (key_->name == "vdots" || key_->name == "ddots")
                ++x;
        if (key_->name != "vdots")
                --y;
-       mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(),
+       mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(),
                key_->name);
        setPosCache(pain, x, y);
 }