return;
// double the size if needed
-#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
+ // FIXME THREAD
static QVector<QPoint> points(32);
-#else
- thread_local QVector<QPoint> points(32);
-#endif
if (np > points.size())
points.resize(2 * np);
int textwidth = 0;
if (tw == 0.0)
// Note that we have to take in account space stretching (word spacing)
- textwidth = fm.width(s) + count(s.begin(), s.end(), ' ') * wordspacing;
+ textwidth = fm.width(s) +
+ static_cast<int>(fm.countExpanders(s) * wordspacing);
else
textwidth = static_cast<int>(tw);
return;
}
- // don't use the pixmap cache,
- do_drawText(x, y, str, dir, f, ff);
+ // don't use the pixmap cache
+ setQPainterPen(computeColor(f.realColor()));
+ if (dir != Auto) {
+ shared_ptr<QTextLayout const> ptl =
+ fm.getTextLayout(s, dir == RtL, wordspacing);
+ ptl->draw(this, QPointF(x, y - fm.maxAscent()));
+ }
+ else {
+ if (font() != ff)
+ setFont(ff);
+ drawText(x, y, str);
+ }
//LYXERR(Debug::PAINTING, "draw " << string(str.toUtf8())
// << " at " << x << "," << y);
}