mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
[composer] Make drawing polygon/polyline follow canvas right click
behaviour (right click ends drawing without adding node)
This commit is contained in:
parent
38fa2980ad
commit
b466c63b9f
@ -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 );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user