Symbol Editor: update the view after relocating the anchor

This commit is contained in:
Maciej Suminski 2018-12-04 09:42:26 +01:00
parent ecff2ed384
commit ca5751fc46
1 changed files with 9 additions and 0 deletions

View File

@ -41,6 +41,7 @@
#include <wildcards_and_files_ext.h>
#include <sch_legacy_plugin.h>
#include <properties.h>
#include <view/view.h>
void LIB_EDIT_FRAME::LoadOneSymbol()
@ -219,5 +220,13 @@ void LIB_EDIT_FRAME::PlaceAnchor()
wxPoint offset( -cross_hair.x, cross_hair.y );
part->SetOffset( offset );
OnModify();
// Refresh the view without changing the viewport
auto view = GetGalCanvas()->GetView();
auto center = view->GetCenter();
center.x += offset.x;
center.y -= offset.y;
view->SetCenter( center );
view->RecacheAllItems();
}
}