Symbol Editor: update the view after relocating the anchor
This commit is contained in:
parent
ecff2ed384
commit
ca5751fc46
|
@ -41,6 +41,7 @@
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
#include <sch_legacy_plugin.h>
|
#include <sch_legacy_plugin.h>
|
||||||
#include <properties.h>
|
#include <properties.h>
|
||||||
|
#include <view/view.h>
|
||||||
|
|
||||||
|
|
||||||
void LIB_EDIT_FRAME::LoadOneSymbol()
|
void LIB_EDIT_FRAME::LoadOneSymbol()
|
||||||
|
@ -219,5 +220,13 @@ void LIB_EDIT_FRAME::PlaceAnchor()
|
||||||
wxPoint offset( -cross_hair.x, cross_hair.y );
|
wxPoint offset( -cross_hair.x, cross_hair.y );
|
||||||
part->SetOffset( offset );
|
part->SetOffset( offset );
|
||||||
OnModify();
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue