From 8d088df4df895fe7ede0a9fb5f79de7f8194ae37 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 11 Mar 2016 10:08:15 +0100 Subject: [PATCH] When using pixmap cache, add word spacing to signature Fixes bug #9971. --- src/frontends/qt4/GuiPainter.cpp | 7 +++++-- src/frontends/qt4/GuiPainter.h | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp index aad38b0326..9204c73348 100644 --- a/src/frontends/qt4/GuiPainter.cpp +++ b/src/frontends/qt4/GuiPainter.cpp @@ -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(f.family()))); @@ -100,6 +102,7 @@ QString GuiPainter::generateStringSignature(QString const & str, FontInfo const Color const & color = f.realColor(); sig.append(QChar(static_cast(color.baseColor))); sig.append(QChar(static_cast(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 diff --git a/src/frontends/qt4/GuiPainter.h b/src/frontends/qt4/GuiPainter.h index 3819ff378f..5aec66ac4c 100644 --- a/src/frontends/qt4/GuiPainter.h +++ b/src/frontends/qt4/GuiPainter.h @@ -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