From: Jean-Marc Lasgouttes Date: Mon, 18 Sep 2017 09:21:18 +0000 (+0200) Subject: Do not presume what the defaults for a new QPainter are X-Git-Tag: lyx-2.4.0dev-acb2ca7b~4541 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=275d306c73e3e0f60e0742adbcb06cce98c48ee5;p=features.git Do not presume what the defaults for a new QPainter are --- diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp index 56e9cc4aec..2c6529a938 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_(lyxrc.use_pixmap_cache && USE_PIXMAP_CACHE) { - // 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(); }