Don't change angle when editing footprint value or reference text

Added 180 degrees to list of selection angles and entry of angles
from -180 to 180 in Footprint Text Properties dialog.

Fixes lp:613616

https://bugs.launchpad.net/kicad/+bug/613616
This commit is contained in:
Kevin Cozens 2016-05-30 14:17:39 -04:00 committed by Wayne Stambaugh
parent f71d3fe7b6
commit d0a860ed8f
3 changed files with 30 additions and 15 deletions

View File

@ -8,8 +8,8 @@
*
* Copyright (C) 2015 Jean-Pierre Charras
* Copyright (C) 2013 Dick Hollenbeck, dick@softplc.com
* Copyright (C) 2008-2013 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -75,7 +75,7 @@ DialogEditModuleText::DialogEditModuleText( PCB_BASE_FRAME* aParent,
m_currentText = aTextMod;
m_OrientValue = 0;
m_OrientValidator.SetRange( -90.0, 90.0 );
m_OrientValidator.SetRange( -180.0, 180.0 );
m_OrientValueCtrl->SetValidator( m_OrientValidator );
m_OrientValidator.SetWindow( m_OrientValueCtrl );
@ -150,10 +150,6 @@ bool DialogEditModuleText::TransferDataToWindow()
PutValueInLocalUnits( *m_TxtWidthCtlr, m_currentText->GetThickness() );
double text_orient = m_currentText->GetTextAngle();
NORMALIZE_ANGLE_90( text_orient );
if( text_orient != 0.0 )
m_Orient->SetSelection( 1 );
if( !m_currentText->IsVisible() )
m_Show->SetSelection( 1 );
@ -166,15 +162,22 @@ bool DialogEditModuleText::TransferDataToWindow()
break;
case 900:
case -2700:
m_Orient->SetSelection( 1 );
break;
case -900:
case 2700:
m_Orient->SetSelection( 2 );
break;
default:
case -1800:
case 1800:
m_Orient->SetSelection( 3 );
break;
default:
m_Orient->SetSelection( 4 );
custom_orientation = true;
break;
}
@ -279,6 +282,10 @@ bool DialogEditModuleText::TransferDataFromWindow()
m_currentText->SetTextAngle( -900 );
break;
case 3:
m_currentText->SetTextAngle( 1800 );
break;
default:
custom_orientation = true;
m_currentText->SetTextAngle( KiROUND( m_OrientValue * 10.0 ) );
@ -301,8 +308,13 @@ bool DialogEditModuleText::TransferDataFromWindow()
m_Orient->SetSelection( 2 );
break;
default:
case -1800:
case 1800:
m_Orient->SetSelection( 3 );
break;
default:
m_Orient->SetSelection( 4 );
m_currentText->SetTextAngle( KiROUND( m_OrientValue * 10.0 ) );
custom_orientation = true;
break;
@ -354,6 +366,10 @@ void DialogEditModuleText::ModuleOrientEvent( wxCommandEvent& event )
m_OrientValue = -90.0;
break;
case 3:
m_OrientValue = 180.0;
break;
default:
custom_orientation = true;
break;
@ -362,4 +378,3 @@ void DialogEditModuleText::ModuleOrientEvent( wxCommandEvent& event )
m_OrientValidator.TransferToWindow();
m_OrientValueCtrl->Enable( custom_orientation );
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May 6 2016)
// C++ code generated with wxFormBuilder (version Apr 24 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -115,13 +115,13 @@ DialogEditModuleText_base::DialogEditModuleText_base( wxWindow* parent, wxWindow
bSizer4->Add( bSizer5, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
wxString m_OrientChoices[] = { _("0.0"), _("+90.0"), _("-90.0"), _("Other") };
wxString m_OrientChoices[] = { _("0.0"), _("+90.0"), _("-90.0"), _("180.0"), _("Other") };
int m_OrientNChoices = sizeof( m_OrientChoices ) / sizeof( wxString );
m_Orient = new wxRadioBox( this, wxID_ANY, _("Orientation"), wxDefaultPosition, wxDefaultSize, m_OrientNChoices, m_OrientChoices, 1, wxRA_SPECIFY_COLS );
m_Orient->SetSelection( 2 );
bSizer4->Add( m_Orient, 0, wxALL|wxEXPAND, 5 );
m_staticTextRotation = new wxStaticText( this, wxID_ANY, _("Rotation (-90.0 to 90.0)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRotation = new wxStaticText( this, wxID_ANY, _("Rotation (-180.0 to 180.0)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRotation->Wrap( -1 );
bSizer4->Add( m_staticTextRotation, 0, wxEXPAND|wxTOP|wxLEFT, 5 );

View File

@ -1739,7 +1739,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;0.0&quot; &quot;+90.0&quot; &quot;-90.0&quot; &quot;Other&quot;</property>
<property name="choices">&quot;0.0&quot; &quot;+90.0&quot; &quot;-90.0&quot; &quot;180.0&quot; &quot;Other&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -1843,7 +1843,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Rotation (-90.0 to 90.0)</property>
<property name="label">Rotation (-180.0 to 180.0)</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>