Don't capture cursor if zone or polygon cancelled.
If the client tool indicates it isn't happy for us to continue (because, for instance, the user has cancelled the Zone Properties dialog), then make sure we don't capture the mouse. Fixes: lp: 1740780 * https://bugs.launchpad.net/kicad/+bug/1740780
This commit is contained in:
parent
5bc5942f36
commit
658d181ec7
|
@ -32,12 +32,12 @@ POLYGON_GEOM_MANAGER::POLYGON_GEOM_MANAGER( CLIENT& aClient ):
|
|||
{}
|
||||
|
||||
|
||||
void POLYGON_GEOM_MANAGER::AddPoint( const VECTOR2I& aPt )
|
||||
bool POLYGON_GEOM_MANAGER::AddPoint( const VECTOR2I& aPt )
|
||||
{
|
||||
// if this is the first point, make sure the client is happy
|
||||
// for us to continue
|
||||
if( !IsPolygonInProgress() && !m_client.OnFirstPoint() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( m_leaderPts.size() > 1 )
|
||||
{
|
||||
|
@ -53,6 +53,7 @@ void POLYGON_GEOM_MANAGER::AddPoint( const VECTOR2I& aPt )
|
|||
}
|
||||
|
||||
m_client.OnGeometryChange( *this );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
/**
|
||||
* Lock in a polygon point.
|
||||
*/
|
||||
void AddPoint( const VECTOR2I& aPt );
|
||||
bool AddPoint( const VECTOR2I& aPt );
|
||||
|
||||
/**
|
||||
* Mark the polygon finished and update the client
|
||||
|
|
|
@ -1309,10 +1309,9 @@ void DRAWING_TOOL::runPolygonEventLoop( POLYGON_GEOM_MANAGER& polyGeomMgr )
|
|||
controls.SetAutoPan( false );
|
||||
controls.CaptureCursor( false );
|
||||
}
|
||||
else // adding a corner
|
||||
// adding a corner
|
||||
else if( polyGeomMgr.AddPoint( cursorPos ) )
|
||||
{
|
||||
polyGeomMgr.AddPoint( cursorPos );
|
||||
|
||||
if( !started )
|
||||
{
|
||||
started = true;
|
||||
|
|
Loading…
Reference in New Issue