X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_decorationinset.C;h=de582f6f9057eafa03c52dbe480c6d53185dfd55;hb=ec5d8718c51e86b6300de5de29732634cace81d3;hp=b1f112cd69f746eb1cd5fbe0095cd28170cf5aac;hpb=85a5ea7bfc80e179a61a99f2955455e84d3384cc;p=lyx.git diff --git a/src/mathed/math_decorationinset.C b/src/mathed/math_decorationinset.C index b1f112cd69..de582f6f90 100644 --- a/src/mathed/math_decorationinset.C +++ b/src/mathed/math_decorationinset.C @@ -21,51 +21,37 @@ MathDecorationInset::MathDecorationInset(int d) } -bool MathDecorationInset::GetLimits() const -{ - return deco_ == LM_underbrace || deco_ == LM_overbrace; -} - - 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_); }