Skip to content
Permalink
Browse files

Only update CAD canvas item geometry when necessary

The call to setRect() in paint() handler was triggering canvas redraws
all the time, keeping one CPU core busy nearly all the time when
CAD dock was active.
  • Loading branch information
wonder-sk committed Sep 11, 2017
1 parent bb20047 commit 7c9105d0ebc2a6619f84114ab84887a129e56c34
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/gui/qgsadvanceddigitizingcanvasitem.cpp
@@ -38,7 +38,8 @@ void QgsAdvancedDigitizingCanvasItem::paint( QPainter *painter )
return;

QgsRectangle mapRect = mMapCanvas->extent();
setRect( mapRect );
if ( rect() != mapRect )
setRect( mapRect );

int nPoints = mAdvancedDigitizingDockWidget->pointsCount();
if ( !nPoints )

1 comment on commit 7c9105d

@3nids

This comment has been minimized.

Copy link
Member

@3nids 3nids commented on 7c9105d Sep 12, 2017

backported to 2.18

Please sign in to comment.
You can’t perform that action at this time.