]> git.lyx.org Git - lyx.git/blob - src/mathed/math_kerninset.C
- revive 1.1.6 eqnarray behaviour when pressing <Del> in the last position of a
[lyx.git] / src / mathed / math_kerninset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_kerninset.h"
8 #include "math_extern.h"
9 #include "math_mathmlstream.h"
10 #include "math_streamstr.h"
11 #include "math_support.h"
12 #include "font.h"
13
14
15 MathKernInset::MathKernInset()
16         : MathNestInset(1)
17 {}
18
19
20 MathInset * MathKernInset::clone() const
21 {
22         return new MathKernInset(*this);
23 }
24
25
26 void MathKernInset::metrics(MathMetricsInfo const & mi) const
27 {
28         LyXFont font;
29         whichFont(font, LM_TC_TEXTRM, mi);
30         double t;
31         extractNumber(cell(0), t);
32         width_   = int(t * lyxfont::width('m', font));
33         ascent_  = 0;
34         descent_ = 0;
35 }
36
37
38 void MathKernInset::draw(Painter &, int, int) const
39 {}
40
41
42 void MathKernInset::write(WriteStream & os) const
43 {
44         os << "\\lyxkern" << cell(0) << "em ";
45 }
46
47
48 void MathKernInset::normalize(NormalStream & os) const
49 {
50         os << "[lyxkern " << cell(0) << "em]";
51 }