]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_decorationinset.C
mathed95.diff
[lyx.git] / src / mathed / math_decorationinset.C
index 40ea45d02f1802a956e0e1f8f2cccf36be9e93e8..de582f6f9057eafa03c52dbe480c6d53185dfd55 100644 (file)
@@ -21,51 +21,37 @@ MathDecorationInset::MathDecorationInset(int d)
 }
 
 
-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_);
 }