]> git.lyx.org Git - lyx.git/blob - src/mathed/math_scriptinset.C
further code uglification to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / math_scriptinset.C
1 #include <config.h>
2 #include "debug.h"
3 #include "support/LOstream.h"
4
5 #ifdef __GNUG__
6 #pragma implementation
7 #endif
8
9 #include "math_scriptinset.h"
10
11
12 MathScriptInset::MathScriptInset(bool up)
13         : MathNestInset(1), up_(up)
14 {}
15
16
17 MathInset * MathScriptInset::clone() const
18 {
19         return new MathScriptInset(*this);
20 }
21
22
23 MathScriptInset const * MathScriptInset::asScriptInset() const
24 {
25         return this;
26 }
27
28 void MathScriptInset::write(std::ostream & os, bool fragile) const
29 {
30         cell(0).write(os, fragile);
31 }
32
33
34 void MathScriptInset::metrics(MathStyles st) const
35 {
36         size_    = st;
37         xcell(0).metrics(st);   
38         width_   = xcell(0).width();
39         ascent_  = xcell(0).ascent();
40         descent_ = xcell(0).descent();
41         //lyxerr << "MathScriptInset::metrics: w: " << width_ << " a: " << ascent_
42         //      << " d: " << descent_ << "\n";
43 }
44
45
46 void MathScriptInset::draw(Painter & pain, int x, int y) const
47 {
48         xo(x);
49         yo(y);
50         xcell(0).draw(pain, x, y);
51 }