mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Simple optimisation: reuse current QPainter if no there's no change in settings.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14078 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
73a4be7143
commit
5c4d89d816
@ -58,6 +58,13 @@ int QLPainter::paperHeight() const
|
|||||||
QPainter & QLPainter::setQPainterPen(QPainter & qp, LColor_color c,
|
QPainter & QLPainter::setQPainterPen(QPainter & qp, LColor_color c,
|
||||||
Painter::line_style ls, Painter::line_width lw)
|
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();
|
QPen pen = qp.pen();
|
||||||
|
|
||||||
pen.setColor(lcolorcache.get(c));
|
pen.setColor(lcolorcache.get(c));
|
||||||
|
@ -147,6 +147,10 @@ private:
|
|||||||
|
|
||||||
/// the working area
|
/// the working area
|
||||||
QWorkArea * qwa_;
|
QWorkArea * qwa_;
|
||||||
|
|
||||||
|
LColor::color current_color_;
|
||||||
|
Painter::line_style current_ls_;
|
||||||
|
Painter::line_width current_lw_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QLPAINTER_H
|
#endif // QLPAINTER_H
|
||||||
|
Loading…
Reference in New Issue
Block a user