Skip to content

Commit ed1e19f

Browse files
vmoram-kuhn
authored andcommittedJul 18, 2013
fix #4819
improves rendering speed of complex rubberbands
1 parent f04abe0 commit ed1e19f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/gui/qgsrubberband.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,9 @@ void QgsRubberBand::paint( QPainter* p )
412412
QList<QgsPoint>::const_iterator it = mPoints.at( i ).constBegin();
413413
for ( ; it != mPoints.at( i ).constEnd(); ++it )
414414
{
415-
pts.append( toCanvasCoordinates( QgsPoint( it->x() + mTranslationOffsetX, it->y() + mTranslationOffsetY ) ) - pos() );
415+
const QPointF cur = toCanvasCoordinates( QgsPoint( it->x() + mTranslationOffsetX, it->y() + mTranslationOffsetY ) ) - pos();
416+
if ( pts.empty() || std::abs( pts.back().x() - cur.x() ) > 1 || std::abs( pts.back().y() - cur.y() ) > 1 )
417+
pts.append( cur );
416418
}
417419

418420
switch ( mGeometryType )

0 commit comments

Comments
 (0)
Please sign in to comment.