When using pixmap cache, add word spacing to signature

Fixes bug #9971.
This commit is contained in:
Jean-Marc Lasgouttes 2016-03-11 10:08:15 +01:00
parent 3b6919217b
commit 8d088df4df
2 changed files with 7 additions and 3 deletions

View File

@ -90,7 +90,9 @@ void GuiPainter::setQPainterPen(QColor const & col,
}
QString GuiPainter::generateStringSignature(QString const & str, FontInfo const & f)
QString GuiPainter::generateStringSignature(QString const & str,
FontInfo const & f,
double wordspacing)
{
QString sig = str;
sig.append(QChar(static_cast<short>(f.family())));
@ -100,6 +102,7 @@ QString GuiPainter::generateStringSignature(QString const & str, FontInfo const
Color const & color = f.realColor();
sig.append(QChar(static_cast<short>(color.baseColor)));
sig.append(QChar(static_cast<short>(color.mergeColor)));
sig.append(QString::number(wordspacing));
if (!monochrome_min_.empty()) {
QColor const & min = monochrome_min_.top();
QColor const & max = monochrome_max_.top();
@ -404,7 +407,7 @@ int GuiPainter::text(int x, int y, docstring const & s,
if (use_pixmap_cache_) {
QPixmap pm;
QString key = generateStringSignature(str, f);
QString key = generateStringSignature(str, f, wordspacing);
// Warning: Left bearing is in general negative! Only the case
// where left bearing is negative is of interest WRT the

View File

@ -203,7 +203,8 @@ private:
/// possibly apply monochrome mode
QColor filterColor(QColor const & col);
///
QString generateStringSignature(QString const & str, FontInfo const & f);
QString generateStringSignature(QString const & str, FontInfo const & f,
double wordspacing);
};
} // namespace frontend