Commit 24a1b05d authored by dickelbeck's avatar dickelbeck

fix TRACK::Copy() usage

parent 38f9963e
...@@ -390,12 +390,18 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC ) ...@@ -390,12 +390,18 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
{ {
next_track = track->Next(); next_track = track->Next();
if( IsSegmentInBox( GetScreen()->BlockLocate, track ) ) if( IsSegmentInBox( GetScreen()->BlockLocate, track ) )
{ /* la piste est ici bonne a etre deplacee */ {
/* la piste est ici bonne a etre deplacee */
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
new_track = track->Copy( 1 ); new_track = track->Copy();
new_track->Insert( m_Pcb, NULL ); new_track->Insert( m_Pcb, NULL );
new_track->m_Start.x += deltaX; new_track->m_Start.y += deltaY;
new_track->m_End.x += deltaX; new_track->m_End.y += deltaY; new_track->m_Start.x += deltaX;
new_track->m_Start.y += deltaY;
new_track->m_End.x += deltaX;
new_track->m_End.y += deltaY;
new_track->Draw( DrawPanel, DC, GR_OR ); // reaffichage new_track->Draw( DrawPanel, DC, GR_OR ); // reaffichage
} }
track = next_track; track = next_track;
...@@ -407,12 +413,21 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC ) ...@@ -407,12 +413,21 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
{ {
next_track = track->Next(); next_track = track->Next();
if( IsSegmentInBox( GetScreen()->BlockLocate, track ) ) if( IsSegmentInBox( GetScreen()->BlockLocate, track ) )
{ /* la piste est ici bonne a etre deplacee */ {
/* la piste est ici bonne a etre deplacee */
// @todo: bug? memory leak at this point:
new_track = new TRACK( m_Pcb ); new_track = new TRACK( m_Pcb );
new_track = track->Copy( 1 );
new_track = track->Copy();
new_track->Insert( m_Pcb, NULL ); new_track->Insert( m_Pcb, NULL );
new_track->m_Start.x += deltaX; new_track->m_Start.y += deltaY;
new_track->m_End.x += deltaX; new_track->m_End.y += deltaY; new_track->m_Start.x += deltaX;
new_track->m_Start.y += deltaY;
new_track->m_End.x += deltaX;
new_track->m_End.y += deltaY;
new_track->Draw( DrawPanel, DC, GR_OR ); // reaffichage new_track->Draw( DrawPanel, DC, GR_OR ); // reaffichage
} }
track = next_track; track = next_track;
......
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