From f92253397882b6eb120f87f5e6db3cf9fd679b09 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 5 Feb 2014 09:05:27 +0100 Subject: [PATCH] Added possibility for editing pads properties. --- pcbnew/tools/edit_tool.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 9d99f3275c..2fa4108047 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -205,6 +205,21 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent ) { // Display properties dialog BOARD_ITEM* item = static_cast( selection.items.GetPickedItem( 0 ) ); + VECTOR2I cursor = getView()->ToWorld( getViewControls()->GetCursorPosition() ); + + // Check if user wants to edit pad or module properties + if( item->Type() == PCB_MODULE_T ) + { + for( D_PAD* pad = static_cast( item )->Pads(); pad; pad = pad->Next() ) + { + if( pad->ViewBBox().Contains( cursor ) ) + { + // Turns out that user wants to edit a pad properties + item = pad; + break; + } + } + } editFrame->SaveCopyInUndoList( item, UR_CHANGED ); editFrame->OnModify();