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
This commit is contained in:
parent
c48084bbbf
commit
3f26b29aa2
|
@ -2582,9 +2582,10 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
m_frame->PopTool( aEvent );
|
||||||
|
|
||||||
// We've handled the cancel event. Don't cancel other tools
|
// We've handled the cancel event. Don't cancel other tools
|
||||||
evt->SetPassEvent( false );
|
evt->SetPassEvent( false );
|
||||||
m_frame->PopTool( aEvent );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,19 +122,16 @@ std::unique_ptr<ZONE> ZONE_CREATE_HELPER::createNewZone( bool aKeepout )
|
||||||
|
|
||||||
if( m_params.m_keepout )
|
if( m_params.m_keepout )
|
||||||
dialogResult = InvokeRuleAreaEditor( frame, &zoneInfo );
|
dialogResult = InvokeRuleAreaEditor( frame, &zoneInfo );
|
||||||
|
else if( ( zoneInfo.m_Layers & LSET::AllCuMask() ).any() )
|
||||||
|
dialogResult = InvokeCopperZonesEditor( frame, &zoneInfo );
|
||||||
else
|
else
|
||||||
{
|
dialogResult = InvokeNonCopperZonesEditor( frame, &zoneInfo );
|
||||||
// TODO(JE) combine these dialogs?
|
|
||||||
if( ( zoneInfo.m_Layers & LSET::AllCuMask() ).any() )
|
|
||||||
dialogResult = InvokeCopperZonesEditor( frame, &zoneInfo );
|
|
||||||
else
|
|
||||||
dialogResult = InvokeNonCopperZonesEditor( frame, &zoneInfo );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( dialogResult == wxID_CANCEL )
|
if( dialogResult == wxID_CANCEL )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
controls->WarpMouseCursor( controls->GetCursorPosition(), true );
|
controls->WarpMouseCursor( controls->GetCursorPosition(), true );
|
||||||
|
frame->GetCanvas()->SetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxASSERT( !m_tool.m_isFootprintEditor || ( parent->Type() == PCB_FOOTPRINT_T ) );
|
wxASSERT( !m_tool.m_isFootprintEditor || ( parent->Type() == PCB_FOOTPRINT_T ) );
|
||||||
|
@ -294,6 +291,14 @@ bool ZONE_CREATE_HELPER::OnFirstPoint( POLYGON_GEOM_MANAGER& aMgr )
|
||||||
|
|
||||||
void ZONE_CREATE_HELPER::OnGeometryChange( const 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
|
// send the points to the preview item
|
||||||
m_previewItem.SetPoints( aMgr.GetLockedInPoints(), aMgr.GetLeaderLinePoints(),
|
m_previewItem.SetPoints( aMgr.GetLockedInPoints(), aMgr.GetLeaderLinePoints(),
|
||||||
aMgr.GetLoopLinePoints() );
|
aMgr.GetLoopLinePoints() );
|
||||||
|
|
Loading…
Reference in New Issue