]> git.lyx.org Git - features.git/commitdiff
remove hack, gain speed...
authorAndré Pönitz <poenitz@gmx.net>
Tue, 12 Mar 2002 13:28:57 +0000 (13:28 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 12 Mar 2002 13:28:57 +0000 (13:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3727 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_support.C

index 21ff9ae1eb0fb0a496ad14747d03cbc0531305f5..78dc7cefd1b134ac66c2960992ec0badf618ad18 100644 (file)
@@ -759,13 +759,17 @@ void drawStr(Painter & pain, MathTextCodes type, MathMetricsInfo const & size,
 void drawChar(Painter & pain, MathTextCodes type, MathMetricsInfo const & size,
        int x, int y, char c)
 {
-       string s;
-       if (isBinaryOp(c, type))
-               s += ' ';
-       s += c;
-       if (isBinaryOp(c, type))
-               s += ' ';
-       drawStr(pain, type, size, x, y, s);
+       LyXFont font;
+       whichFont(font, type, size);
+       if (isBinaryOp(c, type)) {
+               pain.text(x, y, ' ', font);
+               x += lyxfont::width(' ', font);
+               pain.text(x, y, c, font);
+               x += lyxfont::width(c, font);
+               pain.text(x, y, ' ', font);
+       } else {
+               pain.text(x, y, c, font);
+       }
 }