Do not presume what the defaults for a new QPainter are

(cherry picked from commit 275d306c73)
This commit is contained in:
Jean-Marc Lasgouttes 2017-09-18 11:21:18 +02:00
parent c43b6a9ecf
commit 7b99bf6a37

View 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();
}