From 25abdd9e9cf050ebbddd0cf78a36c46900ab7da1 Mon Sep 17 00:00:00 2001 From: Jonatan Liljedahl Date: Tue, 10 Dec 2019 13:07:11 +0100 Subject: [PATCH] eeschema: Fix refreshing of selection shadow on text fields when zooming. Fixes #3652 | https://gitlab.com/kicad/code/kicad/issues/3652 --- eeschema/sch_base_frame.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 311ccd671d..c9207837c5 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -394,7 +394,24 @@ void SCH_BASE_FRAME::RefreshSelection() KIGFX::SCH_VIEW* view = GetCanvas()->GetView(); for( EDA_ITEM* item : selection ) - view->Update( item, KIGFX::REPAINT ); + { + EDA_ITEM* parent = item->GetParent(); + + if( item->Type() == SCH_SHEET_PIN_T ) + { + // Sheet pins aren't in the view. Refresh their parent. + if( parent ) + GetCanvas()->GetView()->Update( parent ); + } + else + { + view->Update( item, KIGFX::REPAINT ); + + // Component children are drawn from their parents. Mark them for re-paint. + if( parent && parent->Type() == SCH_COMPONENT_T ) + GetCanvas()->GetView()->Update( parent, KIGFX::REPAINT ); + } + } } }