]> git.lyx.org Git - lyx.git/blob - src/mathed/textpainter.C
fix for the first item on Martin's list
[lyx.git] / src / mathed / textpainter.C
1 #include "textpainter.h"
2
3
4 TextPainter::TextPainter(int xmax, int ymax)
5         : xmax_(xmax), ymax_(ymax), data_((xmax_ + 1) * (ymax_ + 1))
6 {}
7
8
9 char & TextPainter::at(int x, int y)
10 {
11         return data_[y * xmax_ + x];
12 }
13
14
15 char TextPainter::at(int x, int y) const
16 {
17         return data_[y * xmax_ + x];
18 }
19
20
21 void TextPainter::draw(int x, int y, char const * str)
22 {
23         for (int i = 0; *str; ++i, ++str)
24                 at(x + i, y) = *str;
25 }