}
-bool MathDecorationInset::GetLimits() const
-{
- return deco_ == LM_underbrace || deco_ == LM_overbrace;
-}
-
-
-MathInset * MathDecorationInset::Clone() const
+MathInset * MathDecorationInset::clone() const
{
return new MathDecorationInset(*this);
}
-void MathDecorationInset::draw(Painter & pain, int x, int y)
-{
- xcell(0).draw(pain, x, y);
- mathed_draw_deco(pain, x, y + 10, width_, 10, deco_);
-}
-
void MathDecorationInset::Metrics(MathStyles st)
{
- int const h = 2 * mathed_char_height(LM_TC_VAR, size(), 'I',
- ascent_, descent_);
xcell(0).Metrics(st);
width_ = xcell(0).width();
ascent_ = xcell(0).ascent();
descent_ = xcell(0).descent();
- int w = width() + 4;
- if (w < 16)
- w = 16;
-
- int dh_ = w / 5;
- if (dh_ > h)
- dh_ = h;
+ dh_ = mathed_char_height(LM_TC_VAR, size(), 'I', ascent_, descent_);
- int dy_;
if (upper_) {
- ascent_ += dh_ + 2;
+ ascent_ += dh_ + 1;
dy_ = -ascent_;
} else {
- dy_ = descent_ + 2;
- descent_ += dh_ + 4;
+ dy_ = descent_ + 1;
+ descent_ += dh_ + 2;
}
- width_ = w;
+}
+
+void MathDecorationInset::draw(Painter & pain, int x, int y)
+{
+ xo(x);
+ yo(x);
+ xcell(0).draw(pain, x, y);
+ mathed_draw_deco(pain, x, y + dy_, width_, dh_, deco_);
}