From 67136d21b10f5ae93669eee76800142a1134474d Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 9 Jul 2014 14:01:06 +0200 Subject: [PATCH] MInor fixes. --- pcbnew/class_pad.cpp | 3 +-- pcbnew/tools/drawing_tool.cpp | 12 ++++++------ pcbnew/tools/drawing_tool.h | 14 ++++++++------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index ef2be10951..bd20fd83af 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -255,8 +255,7 @@ void D_PAD::SetLocalCoord() } m_Pos0 = m_Pos - module->GetPosition(); - double angle = module->GetOrientation(); - RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle ); + RotatePoint( &m_Pos0.x, &m_Pos0.y, -module->GetOrientation() ); } diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 37264569a5..e46ce6db27 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -77,7 +77,7 @@ int DRAWING_TOOL::DrawLine( TOOL_EVENT& aEvent ) { m_frame->SetToolID( ID_MODEDIT_LINE_TOOL, wxCURSOR_PENCIL, _( "Add graphic line" ) ); - MODULE* module = m_frame->GetBoard()->m_Modules; + MODULE* module = m_board->m_Modules; EDGE_MODULE* line = new EDGE_MODULE( module ); while( drawSegment( S_SEGMENT, line ) ) @@ -120,7 +120,7 @@ int DRAWING_TOOL::DrawCircle( TOOL_EVENT& aEvent ) { m_frame->SetToolID( ID_MODEDIT_CIRCLE_TOOL, wxCURSOR_PENCIL, _( "Add graphic circle" ) ); - MODULE* module = m_frame->GetBoard()->m_Modules; + MODULE* module = m_board->m_Modules; EDGE_MODULE* circle = new EDGE_MODULE( module ); while( drawSegment( S_CIRCLE, circle ) ) @@ -163,7 +163,7 @@ int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent ) { m_frame->SetToolID( ID_MODEDIT_ARC_TOOL, wxCURSOR_PENCIL, _( "Add graphic arc" ) ); - MODULE* module = m_frame->GetBoard()->m_Modules; + MODULE* module = m_board->m_Modules; EDGE_MODULE* arc = new EDGE_MODULE( module ); while( drawArc( arc ) ) @@ -527,7 +527,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent ) { if( evt->IsAction( &COMMON_ACTIONS::rotate ) ) { - module->Rotate( module->GetPosition(), /*m_frame->GetRotationAngle()*/ 900.0 ); + module->Rotate( module->GetPosition(), m_frame->GetRotationAngle() ); preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); } else if( evt->IsAction( &COMMON_ACTIONS::flip ) ) @@ -1123,7 +1123,7 @@ int DRAWING_TOOL::placeTextModule() { TEXTE_MODULE* text = new TEXTE_MODULE( NULL ); const BOARD_DESIGN_SETTINGS& dsnSettings = m_frame->GetDesignSettings(); - MODULE* module = m_frame->GetBoard()->m_Modules; + MODULE* module = m_board->m_Modules; // Add a VIEW_GROUP that serves as a preview for the new item KIGFX::VIEW_GROUP preview( m_view ); @@ -1202,7 +1202,7 @@ int DRAWING_TOOL::placeTextModule() text->ClearFlags(); // Module has to be saved before any modification is made - m_frame->SaveCopyInUndoList( m_frame->GetBoard()->m_Modules, UR_MODEDIT ); + m_frame->SaveCopyInUndoList( module, UR_MODEDIT ); module->GraphicalItems().PushFront( text ); m_view->Add( text ); diff --git a/pcbnew/tools/drawing_tool.h b/pcbnew/tools/drawing_tool.h index 1137bf2c4c..32c15a8401 100644 --- a/pcbnew/tools/drawing_tool.h +++ b/pcbnew/tools/drawing_tool.h @@ -116,7 +116,7 @@ public: /** * Function PlaceModule() - * Displays a dialog to selected a module to be added and then allows user to set its position. + * Displays a dialog to select a module to be added and allows the user to set its position. */ int PlaceModule( TOOL_EVENT& aEvent ); @@ -165,11 +165,13 @@ private: */ int placeTextPcb(); - ///> Forces a DRAWSEGMENT to be drawn at multiple of 45 degrees. The origin - ///> stays the same, the end of the aSegment is modified according to the - ///> current cursor position. - ///> @param aSegment is the segment that is currently drawn. - ///> @param aHelper is a helper line that shows the next possible segment. + /** + * Function make45DegLine() + * Forces a DRAWSEGMENT to be drawn at multiple of 45 degrees. The origin stays the same, + * the end of the aSegment is modified according to the current cursor position. + * @param aSegment is the segment that is currently drawn. + * @param aHelper is a helper line that shows the next possible segment. + */ void make45DegLine( DRAWSEGMENT* aSegment, DRAWSEGMENT* aHelper ) const; ///> Sets up handlers for various events.