]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fboxinset.C
fix the <...> delimiters
[lyx.git] / src / mathed / math_fboxinset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_fboxinset.h"
8 #include "math_support.h"
9 #include "math_mathmlstream.h"
10 #include "frontends/Painter.h"
11
12
13
14 MathFboxInset::MathFboxInset()
15         : MathNestInset(1)
16 {}
17
18
19 MathInset * MathFboxInset::clone() const
20 {
21         return new MathFboxInset(*this);
22 }
23
24
25 void MathFboxInset::metrics(MathMetricsInfo & mi) const
26 {
27         MathFontSetChanger dummy(mi.base, "textnormal");
28         xcell(0).metrics(mi);
29         ascent_  = xcell(0).ascent()  + 5;
30         descent_ = xcell(0).descent() + 5;
31         width_   = xcell(0).width()   + 10;
32 }
33
34
35 void MathFboxInset::draw(MathPainterInfo & pi, int x, int y) const
36 {
37         MathFontSetChanger dummy(pi.base, "textnormal");
38         pi.pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2,
39                         LColor::black);
40         xcell(0).draw(pi, x + 5, y);
41 }
42
43
44 void MathFboxInset::write(WriteStream & os) const
45 {
46         os << "\\fbox{" << cell(0) << '}';
47 }
48
49
50 void MathFboxInset::normalize(NormalStream & os) const
51 {
52         os << "[fbox " << cell(0) << ']';
53 }