Schematic: label auto orientation needs to respect move/drag/change

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13226
This commit is contained in:
Mike Williams 2022-12-28 14:30:57 -05:00
parent 0c415a7190
commit e65de51fc7
2 changed files with 10 additions and 1 deletions

View File

@ -548,11 +548,16 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
selectedSpinStyle = TEXT_SPIN_STYLE::BOTTOM;
if( m_currentLabel->AutoRotateOnPlacementSupported() )
{
SCH_EDIT_FRAME* frame = static_cast<SCH_EDIT_FRAME*>( m_parentFrame );
m_currentLabel->SetAutoRotateOnPlacement( m_autoRotate->IsChecked() );
frame->AutoRotateItem( frame->GetScreen(), m_currentLabel );
}
else
m_currentLabel->SetAutoRotateOnPlacement( false );
if( m_currentLabel->GetTextSpinStyle() != selectedSpinStyle )
if( !m_currentLabel->AutoRotateOnPlacement()
&& m_currentLabel->GetTextSpinStyle() != selectedSpinStyle )
m_currentLabel->SetTextSpinStyle( selectedSpinStyle );
if( doAutoplace )

View File

@ -931,6 +931,10 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
if( m_isDrag && !isSlice )
trimDanglingLines();
// Auto-rotate any moved labels
for( EDA_ITEM* item : selection )
m_frame->AutoRotateItem( m_frame->GetScreen(), static_cast<SCH_ITEM*>( item ) );
m_frame->RecalculateConnections( LOCAL_CLEANUP );
m_frame->OnModify();
}