From 23e8bafd9cc79eeafd7de300316d53d2e6181530 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 20 Jun 2022 21:15:06 +0100 Subject: [PATCH] Don't run courtyard conflicts in footprint editor. --- pcbnew/tools/edit_tool_move_fct.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index b16395679f..491debf643 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -304,6 +304,7 @@ int EDIT_TOOL::MoveWithReference( const TOOL_EVENT& aEvent ) int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) { PCB_BASE_EDIT_FRAME* editFrame = getEditFrame(); + BOARD* board = editFrame->GetBoard(); KIGFX::VIEW_CONTROLS* controls = getViewControls(); VECTOR2I originalCursorPos = controls->GetCursorPosition(); @@ -317,7 +318,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) }, // Prompt user regarding locked items if in board editor and in free-pad-mode (if // we're not in free-pad mode we delay this until the second RequestSelection()). - frame()->Settings().m_AllowFreePads && !m_isFootprintEditor ); + editFrame->Settings().m_AllowFreePads && !m_isFootprintEditor ); if( m_dragging || selection.Empty() ) return 0; @@ -329,7 +330,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) // Now filter out pads if not in free pads mode. We cannot do this in the first // RequestSelection() as we need the item_layers when a pad is the selection front. - if( !m_isFootprintEditor && !frame()->Settings().m_AllowFreePads ) + if( !m_isFootprintEditor && !editFrame->Settings().m_AllowFreePads ) { selection = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) @@ -401,12 +402,17 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) bool hasRedrawn3D = false; bool allowRedraw3D = editFrame->Settings().m_Display.m_Live3DRefresh; // Courtyard conflicts will be tested only if the LAYER_CONFLICTS_SHADOW gal layer is visible - bool showCourtyardConflicts = editFrame->GetBoard()->IsElementVisible( LAYER_CONFLICTS_SHADOW ); + bool showCourtyardConflicts = !m_isFootprintEditor + && board->IsElementVisible( LAYER_CONFLICTS_SHADOW ); // Used to test courtyard overlaps DRC_TEST_PROVIDER_COURTYARD_CLEARANCE_ON_MOVE drc_on_move; - drc_on_move.Init( editFrame->GetBoard() ); - drc_on_move.SetDRCEngine( m_toolMgr->GetTool()->GetDRCEngine().get() ); + + if( showCourtyardConflicts ) + { + drc_on_move.Init( board ); + drc_on_move.SetDRCEngine( m_toolMgr->GetTool()->GetDRCEngine().get() ); + } // Prime the pump m_toolMgr->RunAction( ACTIONS::refreshPreview ); @@ -632,8 +638,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) m_toolMgr->PostEvent( EVENTS::SelectedItemsModified ); } - m_toolMgr->RunAction( PCB_ACTIONS::updateLocalRatsnest, false, - new VECTOR2I( movement ) ); + m_toolMgr->RunAction( PCB_ACTIONS::updateLocalRatsnest, false, new VECTOR2I( movement ) ); } else if( evt->IsCancelInteractive() || evt->IsActivate() ) {