From ca5751fc46f49aebf8c26cb2a291f98fa8a48e3b Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 4 Dec 2018 09:42:26 +0100 Subject: [PATCH] Symbol Editor: update the view after relocating the anchor --- eeschema/libedit/symbedit.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eeschema/libedit/symbedit.cpp b/eeschema/libedit/symbedit.cpp index cd7bc694c7..c1e62db120 100644 --- a/eeschema/libedit/symbedit.cpp +++ b/eeschema/libedit/symbedit.cpp @@ -41,6 +41,7 @@ #include #include #include +#include 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(); } }