MInor fixes.

This commit is contained in:
Maciej Suminski 2014-07-09 14:01:06 +02:00
parent ad000aefa4
commit 67136d21b1
3 changed files with 15 additions and 14 deletions

View File

@ -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() );
}

View File

@ -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 );

View File

@ -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.