Fix snapping to anchors in PICKER_TOOL & highlighting of pasted items
This commit is contained in:
parent
931a1ccaff
commit
3fb926a8f2
|
@ -871,6 +871,7 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems )
|
||||||
|
|
||||||
for ( auto item : aItems )
|
for ( auto item : aItems )
|
||||||
{
|
{
|
||||||
|
item->SetSelected();
|
||||||
selection.Add( item );
|
selection.Add( item );
|
||||||
editTool->GetCurrentCommit()->Add( item );
|
editTool->GetCurrentCommit()->Add( item );
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,12 +54,16 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
while( OPT_TOOL_EVENT evt = Wait() )
|
while( OPT_TOOL_EVENT evt = Wait() )
|
||||||
{
|
{
|
||||||
|
auto mousePos = controls->GetMousePosition();
|
||||||
|
auto p = grid.BestSnapAnchor( mousePos, nullptr );
|
||||||
|
controls->ForceCursorPosition( true, p );
|
||||||
|
|
||||||
if( evt->IsClick( BUT_LEFT ) )
|
if( evt->IsClick( BUT_LEFT ) )
|
||||||
{
|
{
|
||||||
bool getNext = false;
|
bool getNext = false;
|
||||||
auto cursorPos = controls->GetCursorPosition();
|
|
||||||
m_picked = grid.BestSnapAnchor( cursorPos, nullptr );
|
|
||||||
|
|
||||||
|
m_picked = p;
|
||||||
|
|
||||||
if( m_clickHandler )
|
if( m_clickHandler )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -87,6 +91,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
|
controls->ForceCursorPosition( false );
|
||||||
getEditFrame<PCB_BASE_FRAME>()->SetNoToolSelected();
|
getEditFrame<PCB_BASE_FRAME>()->SetNoToolSelected();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue