Allows new items SCH_NO_CONNECT_T and SCH_BUS_WIRE_ENTRY_T to be repeated.
Fixes #15668 https://gitlab.com/kicad/code/kicad/-/issues/15668
This commit is contained in:
parent
467c672bcd
commit
79590c6372
|
@ -731,6 +731,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
|
||||||
bool loggedInfoBarError = false;
|
bool loggedInfoBarError = false;
|
||||||
wxString description;
|
wxString description;
|
||||||
SCH_SCREEN* screen = m_frame->GetScreen();
|
SCH_SCREEN* screen = m_frame->GetScreen();
|
||||||
|
bool allowRepeat = false; // Set to true to allow new item repetition
|
||||||
|
|
||||||
if( m_inSingleClickPlace )
|
if( m_inSingleClickPlace )
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -757,6 +758,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
|
||||||
previewItem = new SCH_NO_CONNECT( cursorPos );
|
previewItem = new SCH_NO_CONNECT( cursorPos );
|
||||||
previewItem->SetParent( screen );
|
previewItem->SetParent( screen );
|
||||||
description = _( "Add No Connect Flag" );
|
description = _( "Add No Connect Flag" );
|
||||||
|
allowRepeat = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCH_JUNCTION_T:
|
case SCH_JUNCTION_T:
|
||||||
|
@ -769,6 +771,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
|
||||||
previewItem = new SCH_BUS_WIRE_ENTRY( cursorPos );
|
previewItem = new SCH_BUS_WIRE_ENTRY( cursorPos );
|
||||||
previewItem->SetParent( screen );
|
previewItem->SetParent( screen );
|
||||||
description = _( "Add Wire to Bus Entry" );
|
description = _( "Add Wire to Bus Entry" );
|
||||||
|
allowRepeat = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -859,6 +862,9 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
|
||||||
newItem->SetFlags( IS_NEW );
|
newItem->SetFlags( IS_NEW );
|
||||||
m_frame->AddToScreen( newItem, screen );
|
m_frame->AddToScreen( newItem, screen );
|
||||||
|
|
||||||
|
if( allowRepeat )
|
||||||
|
m_frame->SaveCopyForRepeatItem( newItem );
|
||||||
|
|
||||||
SCH_COMMIT commit( m_toolMgr );
|
SCH_COMMIT commit( m_toolMgr );
|
||||||
commit.Added( newItem, screen );
|
commit.Added( newItem, screen );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue