]> git.lyx.org Git - features.git/commitdiff
Do not presume what the defaults for a new QPainter are
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 18 Sep 2017 09:21:18 +0000 (11:21 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 15 Feb 2018 11:29:25 +0000 (12:29 +0100)
(cherry picked from commit 275d306c73e3e0f60e0742adbcb06cce98c48ee5)

src/frontends/qt4/GuiPainter.cpp

index bff8f9dc30d243181aa088dace6a2beb6dac9eb2..b03bb44ad31d33ce5ded5217a9e8e958fb9a5a5c 100644 (file)
@@ -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();
 }