]> git.lyx.org Git - lyx.git/blob - src/mathed/math_scriptinset.C
fix cursor positioning using the mouse
[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 }
37
38
39 void MathScriptInset::draw(Painter & pain, int x, int y) const
40 {
41         xo(x);
42         yo(y);
43         xcell(0).draw(pain, x, y);
44 }