commit 7b99bf6a375e14882713d96338345d130cab1425
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Mon Sep 18 11:21:18 2017 +0200

    Do not presume what the defaults for a new QPainter are
    
    (cherry picked from commit 275d306c73e3e0f60e0742adbcb06cce98c48ee5)
---
 src/frontends/qt4/GuiPainter.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp
index bff8f9d..b03bb44 100644
--- a/src/frontends/qt4/GuiPainter.cpp
+++ b/src/frontends/qt4/GuiPainter.cpp
@@ -52,10 +52,10 @@ GuiPainter::GuiPainter(QPaintDevice * device, double 
pixel_ratio)
        : QPainter(device), Painter(pixel_ratio),
          use_pixmap_cache_(false)
 {
-       // new QPainter has default QPen:
-       current_color_ = guiApp->colorCache().get(Color_black);
-       current_ls_ = line_solid;
-       current_lw_ = thin_line;
+       // set cache correctly
+       current_color_ = pen().color();
+       current_ls_ = pen().style() == Qt::DotLine ? line_onoffdash : 
line_solid;
+       current_lw_ = pen().width();
 }
 
 

Reply via email to