7 #include "math_dotsinset.h"
8 #include "math_mathmlstream.h"
9 #include "math_streamstr.h"
10 #include "math_support.h"
13 MathDotsInset::MathDotsInset(string const & name)
18 MathInset * MathDotsInset::clone() const
20 return new MathDotsInset(*this);
24 void MathDotsInset::metrics(MathMetricsInfo const & mi) const
27 whichFont(font, LM_TC_VAR, mi);
28 mathed_char_dim(font, 'M', ascent_, descent_, width_);
30 case 'l': dh_ = 0; break;
31 case 'c': dh_ = ascent_ / 2; break;
32 case 'v': width_ /= 2;
33 case 'd': dh_ = ascent_; break;
38 void MathDotsInset::draw(Painter & pain, int x, int y) const
40 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
41 char const c = name_[0];
42 if (c == 'v' || c == 'd')
46 mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
50 void MathDotsInset::write(WriteStream & os) const
52 os << '\\' << name_ << ' ';
56 void MathDotsInset::normalize(NormalStream & os) const
58 os << "[" << name_ << "] ";