diff --git a/src/frontends/qt4/QLPainter.C b/src/frontends/qt4/QLPainter.C index 8c19e0766c..1e4dfeed13 100644 --- a/src/frontends/qt4/QLPainter.C +++ b/src/frontends/qt4/QLPainter.C @@ -58,6 +58,13 @@ int QLPainter::paperHeight() const QPainter & QLPainter::setQPainterPen(QPainter & qp, LColor_color c, Painter::line_style ls, Painter::line_width lw) { + if (c == current_color_ && ls == current_ls_ && lw == current_lw_) + return qp; + + current_color_ = c; + current_ls_ = ls; + current_lw_ = lw; + QPen pen = qp.pen(); pen.setColor(lcolorcache.get(c)); diff --git a/src/frontends/qt4/QLPainter.h b/src/frontends/qt4/QLPainter.h index 707fb77468..a7462b6d1d 100644 --- a/src/frontends/qt4/QLPainter.h +++ b/src/frontends/qt4/QLPainter.h @@ -147,6 +147,10 @@ private: /// the working area QWorkArea * qwa_; + + LColor::color current_color_; + Painter::line_style current_ls_; + Painter::line_width current_lw_; }; #endif // QLPAINTER_H