Jürgen Spitzmüller wrote:
Abdelrazak Younes wrote:
It's not just about the pixmap cache but also the metrics cache. I'll
correct trunk soon.

and branch, please (but post the patch first).

Here is it.

Abdel.

Author: younes
Date: Tue Oct  9 16:10:55 2007
New Revision: 20867

URL: http://www.lyx.org/trac/changeset/20867
Log:
clear the pixmap cache and the font metrics cache in case of zoom or dpi changes.


Modified:
    lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp

Modified: lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp?rev=20867
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp (original)
+++ lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp Tue Oct  9 16:10:55 2007
@@ -14,6 +14,7 @@

 #include "qt_helpers.h"
 #include "GuiApplication.h"
+#include "GuiFontLoader.h"

 #include "BufferList.h"
 #include "Color.h"
@@ -40,6 +41,7 @@
 #include <QColorDialog>
 #include <QFontDatabase>
 #include <QLineEdit>
+#include <QPixmapCache>
 #include <QPushButton>
 #include <QSpinBox>
 #include <QString>
@@ -469,6 +471,11 @@
                || rc.sans_font_name != oldrc.sans_font_name
                || rc.typewriter_font_name != oldrc.typewriter_font_name
                || rc.zoom != oldrc.zoom || rc.dpi != oldrc.dpi) {
+               // The global QPixmapCache is used in GuiPainter to cache text
+               // painting so we must reset it in case any of the above
+               // parameter is changed.
+               QPixmapCache::clear();
+               guiApp->fontLoader().update();
                form_->updateScreenFonts();
        }
 }



Reply via email to