KeepUpright should enforce 0..90, not -90..90.

Fixes https://gitlab.com/kicad/code/kicad/issues/5537
This commit is contained in:
Jeff Young 2020-11-09 22:47:57 +00:00
parent 67095af043
commit 5c309f0fef
2 changed files with 7 additions and 6 deletions

View File

@ -254,11 +254,11 @@ double FP_TEXT::GetDrawRotation() const
if( m_keepUpright ) if( m_keepUpright )
{ {
// Keep angle between -90 .. 90 deg. Otherwise the text is not easy to read // Keep angle between 0 .. 90 deg. Otherwise the text is not easy to read
while( rotation > 900 ) while( rotation > 900 )
rotation -= 1800; rotation -= 1800;
while( rotation < -900 ) while( rotation < 0 )
rotation += 1800; rotation += 1800;
} }
else else

View File

@ -972,7 +972,8 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
// If rotating a group, record position of all the descendants for undo // If rotating a group, record position of all the descendants for undo
if( item->Type() == PCB_GROUP_T ) if( item->Type() == PCB_GROUP_T )
{ {
static_cast<PCB_GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) static_cast<PCB_GROUP*>( item )->RunOnDescendants(
[&]( BOARD_ITEM* bItem )
{ {
m_commit->Modify( bItem ); m_commit->Modify( bItem );
}); });