From 618df99c565aff66f6094c2d5edad8dcbc9b3dea Mon Sep 17 00:00:00 2001 From: charras Date: Sun, 26 Jul 2009 19:17:56 +0000 Subject: [PATCH] Rework on undo/redo and block functions: more efficient code to undo/redo block move and mirror operations --- eeschema/geometric_transforms.cpp | 6 ++---- eeschema/schematic_undo_redo.cpp | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/eeschema/geometric_transforms.cpp b/eeschema/geometric_transforms.cpp index aa275a5635..b93518b922 100644 --- a/eeschema/geometric_transforms.cpp +++ b/eeschema/geometric_transforms.cpp @@ -137,9 +137,7 @@ void MirrorOneStruct( SCH_ITEM* DrawStruct, wxPoint& aMirrorPoint ) else if( DrawText->m_Orient == 2 ) /* invert horizontal text*/ DrawText->m_Orient = 0; - px = DrawText->m_Pos; - MirrorYPoint( px, aMirrorPoint ); - DrawText->m_Pos.x = px.x; + MirrorYPoint( DrawText->m_Pos, aMirrorPoint ); break; case TYPE_SCH_COMPONENT: @@ -149,7 +147,7 @@ void MirrorOneStruct( SCH_ITEM* DrawStruct, wxPoint& aMirrorPoint ) WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow(); frame->CmpRotationMiroir( DrawLibItem, NULL, CMP_MIROIR_Y ); 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++ ) { diff --git a/eeschema/schematic_undo_redo.cpp b/eeschema/schematic_undo_redo.cpp index aebd78ad03..8e1317e0d7 100644 --- a/eeschema/schematic_undo_redo.cpp +++ b/eeschema/schematic_undo_redo.cpp @@ -374,6 +374,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList ) { wxPoint moveVector = - aList->m_TransformPoint; MoveOneStruct( item, moveVector ); + aList->m_TransformPoint = moveVector; } break;