From a291cae2fd1f3a9e1239bd9637c628bb2c880d5f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 18 Sep 2021 18:18:41 +0100 Subject: [PATCH] Make sure intersheetRef bounding boxes get updated in RTree. Fixes https://gitlab.com/kicad/code/kicad/issues/9177 --- eeschema/sch_edit_frame.cpp | 10 +++++++--- eeschema/tools/ee_selection_tool.cpp | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index e5748f7e10..ed2217005e 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1369,12 +1369,16 @@ void SCH_EDIT_FRAME::RecomputeIntersheetRefs() /* Refresh all global labels */ for( EDA_ITEM* item : GetScreen()->Items().OfType( SCH_GLOBAL_LABEL_T ) ) { - SCH_GLOBALLABEL* global = static_cast( item ); + SCH_GLOBALLABEL* gLabel = (SCH_GLOBALLABEL*)( item ); + SCH_FIELD* intersheetRef = gLabel->GetIntersheetRefs(); - global->GetIntersheetRefs()->SetVisible( show ); + intersheetRef->SetVisible( show ); if( show ) - GetCanvas()->GetView()->Update( global ); + { + GetScreen()->Update( gLabel ); + GetCanvas()->GetView()->Update( gLabel ); + } } } diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 444593f222..9c1767fcc8 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -609,7 +609,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) // We are checking if we should display a pencil when hovering over anchors // for "auto starting" wires when clicked - if( CollectHits( collector, evt->Position()) ) + if( CollectHits( collector, evt->Position() ) ) { narrowSelection( collector, evt->Position(), false );