2 * \file InsetMathDots.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
9 * Full author contact details are available in file CREDITS.
14 #include "InsetMathDots.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
17 #include "MathParser.h"
19 #include "frontends/FontMetrics.h"
24 InsetMathDots::InsetMathDots(latexkeys const * key)
29 Inset * InsetMathDots::clone() const
31 return new InsetMathDots(*this);
35 void InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const
37 dim = theFontMetrics(mi.base.font).dimension('M');
39 if (key_->name == "cdots" || key_->name == "dotsb"
40 || key_->name == "dotsm" || key_->name == "dotsi")
42 else if (key_->name == "dotsc")
44 else if (key_->name == "vdots") {
45 dim.wid = (dim.wid / 2) + 1;
48 else if (key_->name == "ddots")
50 // Cache the inset dimension.
55 void InsetMathDots::draw(PainterInfo & pain, int x, int y) const
57 Dimension const dim = dimension(*pain.base.bv);
58 mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(),
60 if (key_->name == "vdots" || key_->name == "ddots")
62 if (key_->name != "vdots")
64 mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(),
66 setPosCache(pain, x, y);
70 docstring InsetMathDots::name() const