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"
28 InsetMathDots::InsetMathDots(latexkeys const * key)
33 auto_ptr<Inset> InsetMathDots::doClone() const
35 return auto_ptr<Inset>(new InsetMathDots(*this));
39 bool InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const
41 dim = theFontMetrics(mi.base.font).dimension('M');
43 if (key_->name == "cdots" || key_->name == "dotsb"
44 || key_->name == "dotsm" || key_->name == "dotsi")
46 else if (key_->name == "dotsc")
48 else if (key_->name == "vdots") {
49 dim.wid = (dim.wid / 2) + 1;
52 else if (key_->name == "ddots")
61 void InsetMathDots::draw(PainterInfo & pain, int x, int y) const
63 mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(),
65 if (key_->name == "vdots" || key_->name == "ddots")
67 if (key_->name != "vdots")
69 mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(),
71 setPosCache(pain, x, y);
75 docstring InsetMathDots::name() const