Isolate painter in selection square.

This commit is contained in:
Teo Mrnjavac 2015-12-17 14:00:26 +01:00
parent d164ec4d91
commit 1a4b6b1c9c

View File

@ -129,6 +129,7 @@ drawPartitionSquare( QPainter* painter, const QRect& rect, const QBrush& brush )
static void static void
drawSelectionSquare( QPainter* painter, const QRect& rect, const QBrush& brush ) drawSelectionSquare( QPainter* painter, const QRect& rect, const QBrush& brush )
{ {
painter->save();
painter->setPen( QPen( brush.color().darker(), 1 ) ); painter->setPen( QPen( brush.color().darker(), 1 ) );
QColor highlightColor = QPalette().highlight().color(); QColor highlightColor = QPalette().highlight().color();
highlightColor = highlightColor.lighter( 500 ); highlightColor = highlightColor.lighter( 500 );
@ -137,6 +138,7 @@ drawSelectionSquare( QPainter* painter, const QRect& rect, const QBrush& brush )
painter->translate( .5, .5 ); painter->translate( .5, .5 );
painter->drawRoundedRect( rect.adjusted( 0, 0, -1, -1 ), CORNER_RADIUS, CORNER_RADIUS ); painter->drawRoundedRect( rect.adjusted( 0, 0, -1, -1 ), CORNER_RADIUS, CORNER_RADIUS );
painter->translate( -.5, -.5 ); painter->translate( -.5, -.5 );
painter->restore();
} }