Ignore duplicate/repeat when drawing an existing item.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16885
This commit is contained in:
parent
9d40374baf
commit
3caede3799
|
@ -466,7 +466,8 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( evt->IsAction( &ACTIONS::duplicate ) )
|
else if( evt->IsAction( &ACTIONS::duplicate )
|
||||||
|
|| evt->IsAction( &EE_ACTIONS::repeatDrawItem ) )
|
||||||
{
|
{
|
||||||
if( symbol )
|
if( symbol )
|
||||||
{
|
{
|
||||||
|
@ -724,6 +725,21 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
m_menu.ShowContextMenu( m_selectionTool->GetSelection() );
|
m_menu.ShowContextMenu( m_selectionTool->GetSelection() );
|
||||||
}
|
}
|
||||||
|
else if( evt->IsAction( &ACTIONS::duplicate )
|
||||||
|
|| evt->IsAction( &EE_ACTIONS::repeatDrawItem ) )
|
||||||
|
{
|
||||||
|
if( image )
|
||||||
|
{
|
||||||
|
// This doesn't really make sense; we'll just end up dragging a stack of
|
||||||
|
// objects so we ignore the duplicate and just carry on.
|
||||||
|
wxBell();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exit. The duplicate will run in its own loop.
|
||||||
|
m_frame->PopTool( aEvent );
|
||||||
|
break;
|
||||||
|
}
|
||||||
else if( image && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
|
else if( image && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
|
||||||
{
|
{
|
||||||
image->SetPosition( cursorPos );
|
image->SetPosition( cursorPos );
|
||||||
|
@ -1686,6 +1702,21 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||||
item = nullptr;
|
item = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if( evt->IsAction( &ACTIONS::duplicate )
|
||||||
|
|| evt->IsAction( &EE_ACTIONS::repeatDrawItem ) )
|
||||||
|
{
|
||||||
|
if( item )
|
||||||
|
{
|
||||||
|
// This doesn't really make sense; we'll just end up dragging a stack of
|
||||||
|
// objects so we ignore the duplicate and just carry on.
|
||||||
|
wxBell();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exit. The duplicate will run in its own loop.
|
||||||
|
m_frame->PopTool( aEvent );
|
||||||
|
break;
|
||||||
|
}
|
||||||
else if( item && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
|
else if( item && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
|
||||||
{
|
{
|
||||||
item->SetPosition( cursorPos );
|
item->SetPosition( cursorPos );
|
||||||
|
@ -1916,6 +1947,21 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
|
||||||
m_toolMgr->PostAction( ACTIONS::activatePointEditor );
|
m_toolMgr->PostAction( ACTIONS::activatePointEditor );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if( evt->IsAction( &ACTIONS::duplicate )
|
||||||
|
|| evt->IsAction( &EE_ACTIONS::repeatDrawItem ) )
|
||||||
|
{
|
||||||
|
if( item )
|
||||||
|
{
|
||||||
|
// This doesn't really make sense; we'll just end up dragging a stack of
|
||||||
|
// objects so we ignore the duplicate and just carry on.
|
||||||
|
wxBell();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exit. The duplicate will run in its own loop.
|
||||||
|
m_frame->PopTool( aEvent );
|
||||||
|
break;
|
||||||
|
}
|
||||||
else if( item && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
|
else if( item && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
|
||||||
{
|
{
|
||||||
item->CalcEdit( cursorPos );
|
item->CalcEdit( cursorPos );
|
||||||
|
@ -2151,6 +2197,21 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
sheet = nullptr;
|
sheet = nullptr;
|
||||||
}
|
}
|
||||||
|
else if( evt->IsAction( &ACTIONS::duplicate )
|
||||||
|
|| evt->IsAction( &EE_ACTIONS::repeatDrawItem ) )
|
||||||
|
{
|
||||||
|
if( sheet )
|
||||||
|
{
|
||||||
|
// This doesn't really make sense; we'll just end up dragging a stack of
|
||||||
|
// objects so we ignore the duplicate and just carry on.
|
||||||
|
wxBell();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exit. The duplicate will run in its own loop.
|
||||||
|
m_frame->PopTool( aEvent );
|
||||||
|
break;
|
||||||
|
}
|
||||||
else if( sheet && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
|
else if( sheet && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
|
||||||
{
|
{
|
||||||
sizeSheet( sheet, cursorPos );
|
sizeSheet( sheet, cursorPos );
|
||||||
|
|
Loading…
Reference in New Issue