Skip to content
Permalink
Browse files

[composer] Make drawing polygon/polyline follow canvas right click

behaviour (right click ends drawing without adding node)
  • Loading branch information
nyalldawson committed Apr 1, 2016
1 parent 38fa298 commit b466c63b9f599f5cabd6d4f6b7f6ea1bdaa34762
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/gui/qgscomposerview.cpp
@@ -796,6 +796,9 @@ void QgsComposerView::mouseReleaseEvent( QMouseEvent* e )
if ( ! mPolygonItem.isNull() )
{
QPolygonF poly = mPolygonItem.data()->polygon();

// last (temporary) point is removed
poly.remove( poly.count() - 1 );
if ( poly.size() >= 3 )
{
mPolygonItem.data()->setPolygon( poly );
@@ -827,7 +830,9 @@ void QgsComposerView::mouseReleaseEvent( QMouseEvent* e )
// ignore the last point due to release event before doubleClick event
QPolygonF poly = mPolygonItem.data()->polygon();

if ( poly.size() >= 3 )
// last (temporary) point is removed
poly.remove( poly.count() - 1 );
if ( poly.size() >= 2 )
{
mPolygonItem.data()->setPolygon( poly );

0 comments on commit b466c63

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