Minor cleanup and removal of stale comments.
Also attempts to fix a focus-loss bug on GTK after zone dialog.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13221
(cherry picked from commit 3f26b29aa2
)
This commit is contained in:
parent
7673f220a9
commit
7d409b9404
|
@ -2638,9 +2638,10 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool( aEvent );
|
||||
|
||||
// We've handled the cancel event. Don't cancel other tools
|
||||
evt->SetPassEvent( false );
|
||||
m_frame->PopTool( aEvent );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,19 +125,16 @@ std::unique_ptr<ZONE> ZONE_CREATE_HELPER::createNewZone( bool aKeepout )
|
|||
|
||||
if( m_params.m_keepout )
|
||||
dialogResult = InvokeRuleAreaEditor( frame, &zoneInfo );
|
||||
else if( ( zoneInfo.m_Layers & LSET::AllCuMask() ).any() )
|
||||
dialogResult = InvokeCopperZonesEditor( frame, &zoneInfo );
|
||||
else
|
||||
{
|
||||
// TODO(JE) combine these dialogs?
|
||||
if( ( zoneInfo.m_Layers & LSET::AllCuMask() ).any() )
|
||||
dialogResult = InvokeCopperZonesEditor( frame, &zoneInfo );
|
||||
else
|
||||
dialogResult = InvokeNonCopperZonesEditor( frame, &zoneInfo );
|
||||
}
|
||||
dialogResult = InvokeNonCopperZonesEditor( frame, &zoneInfo );
|
||||
|
||||
if( dialogResult == wxID_CANCEL )
|
||||
return nullptr;
|
||||
|
||||
controls->WarpMouseCursor( controls->GetCursorPosition(), true );
|
||||
frame->GetCanvas()->SetFocus();
|
||||
}
|
||||
|
||||
// The new zone is a ZONE if created in the board editor and a FP_ZONE if created in the
|
||||
|
@ -307,6 +304,14 @@ bool ZONE_CREATE_HELPER::OnFirstPoint( POLYGON_GEOM_MANAGER& aMgr )
|
|||
|
||||
void ZONE_CREATE_HELPER::OnGeometryChange( const POLYGON_GEOM_MANAGER& aMgr )
|
||||
{
|
||||
// Handle a cancel-interactive
|
||||
if( m_zone && !aMgr.IsPolygonInProgress() )
|
||||
{
|
||||
m_zone = nullptr;
|
||||
m_parentView.SetVisible( &m_previewItem, false );
|
||||
return;
|
||||
}
|
||||
|
||||
// send the points to the preview item
|
||||
m_previewItem.SetPoints( aMgr.GetLockedInPoints(), aMgr.GetLeaderLinePoints(),
|
||||
aMgr.GetLoopLinePoints() );
|
||||
|
|
Loading…
Reference in New Issue