diff --git a/common/drawtxt.cpp b/common/drawtxt.cpp index 080181cc61..eee2339567 100644 --- a/common/drawtxt.cpp +++ b/common/drawtxt.cpp @@ -193,12 +193,14 @@ void DrawGraphicHaloText( EDA_RECT* aClipBox, wxDC * aDC, aColor2 = c; } + // Draw the background DrawGraphicText( aClipBox, aDC, aPos, aColor1, aText, aOrient, aSize, aH_justify, aV_justify, aWidth, aItalic, aBold, aCallback, aPlotter ); + // Draw the text DrawGraphicText( aClipBox, aDC, aPos, aColor2, aText, aOrient, aSize, - aH_justify, aV_justify, aWidth / 4, aItalic, aBold, + aH_justify, aV_justify, aWidth/4, aItalic, aBold, aCallback, aPlotter ); } diff --git a/common/eda_text.cpp b/common/eda_text.cpp index 455568cc87..e48df1e92f 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -88,6 +88,13 @@ EDA_TEXT::~EDA_TEXT() } +void EDA_TEXT::SetOrientation( double aOrientation ) +{ + m_Orient = aOrientation; + NORMALIZE_ANGLE_360( m_Orient ); +} + + int EDA_TEXT::LenSize( const wxString& aLine ) const { basic_gal.SetItalic( m_Italic ); diff --git a/common/gal/stroke_font.cpp b/common/gal/stroke_font.cpp index 6bb8360885..c2796e672e 100644 --- a/common/gal/stroke_font.cpp +++ b/common/gal/stroke_font.cpp @@ -260,10 +260,18 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText ) // Compute the text size VECTOR2D textSize = computeTextLineSize( aText ); + double half_thickness = m_gal->GetLineWidth()/2; + + // First adjust: the text X position is corrected by half_thickness + // because when the text with thickness is draw, its full size is textSize, + // but the position of lines is half_thickness to textSize - half_thickness + // so we must translate the coordinates by half_thickness on the X axis + // to place the text inside the 0 to textSize X area. + m_gal->Translate( VECTOR2D( half_thickness, 0 ) ); m_gal->Save(); - // Adjust the text position to the given alignment + // Adjust the text position to the given horizontal justification switch( m_horizontalJustify ) { case GR_TEXT_HJUSTIFY_CENTER: @@ -289,7 +297,7 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText ) // In case of mirrored text invert the X scale of points and their X direction // (m_glyphSize.x) and start drawing from the position where text normally should end // (textSize.x) - xOffset = textSize.x; + xOffset = textSize.x - m_gal->GetLineWidth(); glyphSize.x = -m_glyphSize.x; } else diff --git a/include/eda_text.h b/include/eda_text.h index 5a0e48ba39..d72e21b6ea 100644 --- a/include/eda_text.h +++ b/include/eda_text.h @@ -133,10 +133,7 @@ public: */ int GetThickness() const { return m_Thickness; }; - void SetOrientation( double aOrientation ) - { - m_Orient = aOrientation; - } + void SetOrientation( double aOrientation ); double GetOrientation() const { return m_Orient; } void SetItalic( bool isItalic ) { m_Italic = isItalic; } diff --git a/include/trigo.h b/include/trigo.h index 92b39dbace..4b3a5ad6af 100644 --- a/include/trigo.h +++ b/include/trigo.h @@ -201,9 +201,9 @@ inline double RAD2DECIDEG( double rad ) { return rad * 1800.0 / M_PI; } /// Normalize angle to be in the -360.0 .. 360.0: template inline void NORMALIZE_ANGLE_360( T &Angle ) { - while( Angle < -3600 ) + while( Angle <= -3600 ) Angle += 3600; - while( Angle > 3600 ) + while( Angle >= 3600 ) Angle -= 3600; } diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.cpp b/pcbnew/dialogs/dialog_pcb_text_properties.cpp index 4d78c42bfa..a9c09e9a0c 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties.cpp @@ -89,6 +89,8 @@ DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent, m_OrientValidator.SetWindow( m_OrientCtrl ); m_StandardSizerOK->SetDefault(); + + GetSizer()->Fit( this ); GetSizer()->SetSizeHints( this ); Centre(); } diff --git a/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp b/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp index 95f7b15cc5..672cae8312 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 9 2016) +// C++ code generated with wxFormBuilder (version Mar 28 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -32,7 +32,7 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare bSizer9->Add( m_TextContentCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 6, 4, 0, 0 ); + fgSizer1 = new wxFlexGridSizer( 0, 4, 0, 0 ); fgSizer1->AddGrowableCol( 0 ); fgSizer1->AddGrowableCol( 1 ); fgSizer1->AddGrowableCol( 2 ); @@ -42,76 +42,76 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare m_SizeXLabel = new wxStaticText( this, wxID_ANY, _("Width:"), wxDefaultPosition, wxDefaultSize, 0 ); m_SizeXLabel->Wrap( -1 ); - fgSizer1->Add( m_SizeXLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_SizeXLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); m_PositionXLabel = new wxStaticText( this, wxID_ANY, _("Position X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_PositionXLabel->Wrap( -1 ); - fgSizer1->Add( m_PositionXLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_PositionXLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); m_LayerLabel = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); m_LayerLabel->Wrap( -1 ); - fgSizer1->Add( m_LayerLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_LayerLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); m_staticText10 = new wxStaticText( this, wxID_ANY, _("Display:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText10->Wrap( -1 ); - fgSizer1->Add( m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); m_SizeXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_SizeXCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_SizeXCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); m_PositionXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_PositionXCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_PositionXCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); m_LayerSelectionCtrl = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - fgSizer1->Add( m_LayerSelectionCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_LayerSelectionCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); wxString m_DisplayCtrlChoices[] = { _("Normal"), _("Mirrored") }; int m_DisplayCtrlNChoices = sizeof( m_DisplayCtrlChoices ) / sizeof( wxString ); m_DisplayCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DisplayCtrlNChoices, m_DisplayCtrlChoices, 0 ); m_DisplayCtrl->SetSelection( 0 ); - fgSizer1->Add( m_DisplayCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_DisplayCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); m_SizeYLabel = new wxStaticText( this, wxID_ANY, _("Height:"), wxDefaultPosition, wxDefaultSize, 0 ); m_SizeYLabel->Wrap( -1 ); - fgSizer1->Add( m_SizeYLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_SizeYLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); m_PositionYLabel = new wxStaticText( this, wxID_ANY, _("Position Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_PositionYLabel->Wrap( -1 ); - fgSizer1->Add( m_PositionYLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_PositionYLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); m_staticText9 = new wxStaticText( this, wxID_ANY, _("Style:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText9->Wrap( -1 ); - fgSizer1->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); m_staticText11 = new wxStaticText( this, wxID_ANY, _("Justification:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText11->Wrap( -1 ); - fgSizer1->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); m_SizeYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_SizeYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_SizeYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); m_PositionYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_PositionYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_PositionYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); wxString m_StyleCtrlChoices[] = { _("Normal"), _("Italic") }; int m_StyleCtrlNChoices = sizeof( m_StyleCtrlChoices ) / sizeof( wxString ); m_StyleCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_StyleCtrlNChoices, m_StyleCtrlChoices, 0 ); m_StyleCtrl->SetSelection( 0 ); - fgSizer1->Add( m_StyleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_StyleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); wxString m_justifyChoiceChoices[] = { _("Left"), _("Center"), _("Right") }; int m_justifyChoiceNChoices = sizeof( m_justifyChoiceChoices ) / sizeof( wxString ); m_justifyChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_justifyChoiceNChoices, m_justifyChoiceChoices, 0 ); m_justifyChoice->SetSelection( 0 ); - fgSizer1->Add( m_justifyChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_justifyChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); m_ThicknessLabel = new wxStaticText( this, wxID_ANY, _("Thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); m_ThicknessLabel->Wrap( -1 ); - fgSizer1->Add( m_ThicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_ThicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); m_orientationLabel = new wxStaticText( this, wxID_ANY, _("Orientation (deg):"), wxDefaultPosition, wxDefaultSize, 0 ); m_orientationLabel->Wrap( -1 ); - fgSizer1->Add( m_orientationLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_orientationLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 3 ); fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -120,13 +120,22 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); m_ThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_ThicknessCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_ThicknessCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); m_OrientCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_OrientCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + fgSizer1->Add( m_OrientCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - bSizer9->Add( fgSizer1, 1, wxALL|wxEXPAND, 5 ); + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + + + bSizer9->Add( fgSizer1, 0, wxALL|wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer9->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); m_StandardSizer = new wxStdDialogButtonSizer(); m_StandardSizerOK = new wxButton( this, wxID_OK ); @@ -143,7 +152,6 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare this->SetSizer( bMainSizer ); this->Layout(); - bMainSizer->Fit( this ); this->Centre( wxBOTH ); } diff --git a/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp b/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp index 1e88fb5a71..7c4ceee59a 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp @@ -44,7 +44,7 @@ -1,-1 DIALOG_PCB_TEXT_PROPERTIES_BASE - -1,-1 + 510,405 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU DIALOG_SHIM; dialog_shim.h Text Properties @@ -279,7 +279,7 @@ 5 wxALL|wxEXPAND - 1 + 0 4 wxBOTH @@ -290,11 +290,11 @@ fgSizer1 wxFLEX_GROWMODE_SPECIFIED none - 6 + 0 0 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -377,7 +377,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -460,7 +460,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -543,7 +543,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -626,7 +626,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -717,7 +717,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -808,7 +808,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -899,7 +899,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -987,7 +987,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1070,7 +1070,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1153,7 +1153,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1236,7 +1236,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1319,7 +1319,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -1410,7 +1410,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -1501,7 +1501,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -1589,7 +1589,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -1677,7 +1677,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1760,7 +1760,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1863,7 +1863,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -1954,7 +1954,7 @@ 3 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 1 @@ -2043,6 +2043,107 @@ + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_pcb_text_properties_base.h b/pcbnew/dialogs/dialog_pcb_text_properties_base.h index 771522286e..9954faea7b 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties_base.h +++ b/pcbnew/dialogs/dialog_pcb_text_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 9 2016) +// C++ code generated with wxFormBuilder (version Mar 28 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -25,6 +25,7 @@ class PCB_LAYER_BOX_SELECTOR; #include #include #include +#include #include #include @@ -61,13 +62,14 @@ class DIALOG_PCB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_orientationLabel; wxTextCtrl* m_ThicknessCtrl; wxTextCtrl* m_OrientCtrl; + wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_StandardSizer; wxButton* m_StandardSizerOK; wxButton* m_StandardSizerCancel; public: - DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU ); + DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 510,405 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU ); ~DIALOG_PCB_TEXT_PROPERTIES_BASE(); }; diff --git a/pcbnew/edit_pcb_text.cpp b/pcbnew/edit_pcb_text.cpp index bae9b3a202..0115be3a19 100644 --- a/pcbnew/edit_pcb_text.cpp +++ b/pcbnew/edit_pcb_text.cpp @@ -237,15 +237,13 @@ TEXTE_PCB* PCB_EDIT_FRAME::CreateTextePcb( wxDC* aDC, TEXTE_PCB* aText ) void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) { - int angle = 900; - if( TextePcb == NULL ) return; // Erase previous text: TextePcb->Draw( m_canvas, DC, GR_XOR ); - TextePcb->SetOrientation( TextePcb->GetOrientation() + angle ); + TextePcb->SetOrientation( TextePcb->GetOrientation() + 900 ); // Redraw text in new position: TextePcb->Draw( m_canvas, DC, GR_XOR );