Rework on undo/redo and block functions: more efficient code to undo/redo block move and mirror operations

This commit is contained in:
charras 2009-07-26 19:17:56 +00:00
parent 83be1f8a10
commit 618df99c56
2 changed files with 3 additions and 4 deletions

View File

@ -137,9 +137,7 @@ void MirrorOneStruct( SCH_ITEM* DrawStruct, wxPoint& aMirrorPoint )
else if( DrawText->m_Orient == 2 ) /* invert horizontal text*/ else if( DrawText->m_Orient == 2 ) /* invert horizontal text*/
DrawText->m_Orient = 0; DrawText->m_Orient = 0;
px = DrawText->m_Pos; MirrorYPoint( DrawText->m_Pos, aMirrorPoint );
MirrorYPoint( px, aMirrorPoint );
DrawText->m_Pos.x = px.x;
break; break;
case TYPE_SCH_COMPONENT: case TYPE_SCH_COMPONENT:
@ -149,7 +147,7 @@ void MirrorOneStruct( SCH_ITEM* DrawStruct, wxPoint& aMirrorPoint )
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow(); WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow();
frame->CmpRotationMiroir( DrawLibItem, NULL, CMP_MIROIR_Y ); frame->CmpRotationMiroir( DrawLibItem, NULL, CMP_MIROIR_Y );
MirrorYPoint( DrawLibItem->m_Pos, aMirrorPoint ); MirrorYPoint( DrawLibItem->m_Pos, aMirrorPoint );
dx -= DrawLibItem->m_Pos.x; dx -= DrawLibItem->m_Pos.x; // dx,0 is the move vector for this transform
for( int ii = 0; ii < DrawLibItem->GetFieldCount(); ii++ ) for( int ii = 0; ii < DrawLibItem->GetFieldCount(); ii++ )
{ {

View File

@ -374,6 +374,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
{ {
wxPoint moveVector = - aList->m_TransformPoint; wxPoint moveVector = - aList->m_TransformPoint;
MoveOneStruct( item, moveVector ); MoveOneStruct( item, moveVector );
aList->m_TransformPoint = moveVector;
} }
break; break;