Commit 67136d21 authored by Maciej Suminski's avatar Maciej Suminski

MInor fixes.

parent ad000aef
...@@ -255,8 +255,7 @@ void D_PAD::SetLocalCoord() ...@@ -255,8 +255,7 @@ void D_PAD::SetLocalCoord()
} }
m_Pos0 = m_Pos - module->GetPosition(); m_Pos0 = m_Pos - module->GetPosition();
double angle = module->GetOrientation(); RotatePoint( &m_Pos0.x, &m_Pos0.y, -module->GetOrientation() );
RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
} }
......
...@@ -77,7 +77,7 @@ int DRAWING_TOOL::DrawLine( TOOL_EVENT& aEvent ) ...@@ -77,7 +77,7 @@ int DRAWING_TOOL::DrawLine( TOOL_EVENT& aEvent )
{ {
m_frame->SetToolID( ID_MODEDIT_LINE_TOOL, wxCURSOR_PENCIL, _( "Add graphic line" ) ); 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 ); EDGE_MODULE* line = new EDGE_MODULE( module );
while( drawSegment( S_SEGMENT, line ) ) while( drawSegment( S_SEGMENT, line ) )
...@@ -120,7 +120,7 @@ int DRAWING_TOOL::DrawCircle( TOOL_EVENT& aEvent ) ...@@ -120,7 +120,7 @@ int DRAWING_TOOL::DrawCircle( TOOL_EVENT& aEvent )
{ {
m_frame->SetToolID( ID_MODEDIT_CIRCLE_TOOL, wxCURSOR_PENCIL, _( "Add graphic circle" ) ); 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 ); EDGE_MODULE* circle = new EDGE_MODULE( module );
while( drawSegment( S_CIRCLE, circle ) ) while( drawSegment( S_CIRCLE, circle ) )
...@@ -163,7 +163,7 @@ int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent ) ...@@ -163,7 +163,7 @@ int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent )
{ {
m_frame->SetToolID( ID_MODEDIT_ARC_TOOL, wxCURSOR_PENCIL, _( "Add graphic arc" ) ); 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 ); EDGE_MODULE* arc = new EDGE_MODULE( module );
while( drawArc( arc ) ) while( drawArc( arc ) )
...@@ -527,7 +527,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent ) ...@@ -527,7 +527,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
{ {
if( evt->IsAction( &COMMON_ACTIONS::rotate ) ) 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 ); preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
} }
else if( evt->IsAction( &COMMON_ACTIONS::flip ) ) else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
...@@ -1123,7 +1123,7 @@ int DRAWING_TOOL::placeTextModule() ...@@ -1123,7 +1123,7 @@ int DRAWING_TOOL::placeTextModule()
{ {
TEXTE_MODULE* text = new TEXTE_MODULE( NULL ); TEXTE_MODULE* text = new TEXTE_MODULE( NULL );
const BOARD_DESIGN_SETTINGS& dsnSettings = m_frame->GetDesignSettings(); 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 // Add a VIEW_GROUP that serves as a preview for the new item
KIGFX::VIEW_GROUP preview( m_view ); KIGFX::VIEW_GROUP preview( m_view );
...@@ -1202,7 +1202,7 @@ int DRAWING_TOOL::placeTextModule() ...@@ -1202,7 +1202,7 @@ int DRAWING_TOOL::placeTextModule()
text->ClearFlags(); text->ClearFlags();
// Module has to be saved before any modification is made // 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 ); module->GraphicalItems().PushFront( text );
m_view->Add( text ); m_view->Add( text );
......
...@@ -116,7 +116,7 @@ public: ...@@ -116,7 +116,7 @@ public:
/** /**
* Function PlaceModule() * 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 ); int PlaceModule( TOOL_EVENT& aEvent );
...@@ -165,11 +165,13 @@ private: ...@@ -165,11 +165,13 @@ private:
*/ */
int placeTextPcb(); 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 * Function make45DegLine()
///> current cursor position. * Forces a DRAWSEGMENT to be drawn at multiple of 45 degrees. The origin stays the same,
///> @param aSegment is the segment that is currently drawn. * the end of the aSegment is modified according to the current cursor position.
///> @param aHelper is a helper line that shows the next possible segment. * @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; void make45DegLine( DRAWSEGMENT* aSegment, DRAWSEGMENT* aHelper ) const;
///> Sets up handlers for various events. ///> Sets up handlers for various events.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment