]> git.lyx.org Git - lyx.git/blob - src/mathed/math_scriptinset.C
9e8732797e8f11824554d5ff0a1281198b5b0d76
[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 void MathScriptInset::write(std::ostream & os, bool fragile) const
24 {
25         cell(0).write(os, fragile);
26 }
27
28
29 void MathScriptInset::metrics(MathStyles st) const
30 {
31         size_    = st;
32         xcell(0).metrics(st);   
33         width_   = xcell(0).width();
34         ascent_  = xcell(0).ascent();
35         descent_ = xcell(0).descent();
36         //lyxerr << "MathScriptInset::metrics: w: " << width_ << " a: " << ascent_
37         //      << " d: " << descent_ << "\n";
38 }
39
40
41 void MathScriptInset::draw(Painter & pain, int x, int y) const
42 {
43         xo(x);
44         yo(y);
45         xcell(0).draw(pain, x, y);
46 }