From eedf319ba4c42c7d0a676bf4adf4d48041ccc9e8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 10 Jul 2023 19:31:12 +0100 Subject: [PATCH] Don't double-offset effective text shapes. Also fixes several bugs with intersheet ref fields. (It's possible for other fields to have an ID of 0.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/15165 --- common/eda_text.cpp | 2 +- eeschema/dialogs/dialog_field_properties.cpp | 2 +- eeschema/sch_field.h | 2 +- eeschema/tools/ee_selection_tool.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/eda_text.cpp b/common/eda_text.cpp index 609f699f04..c2d6e2cb16 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -919,7 +919,7 @@ std::shared_ptr EDA_TEXT::GetEffectiveTextShape( bool aTriangula attrs.m_Angle = GetDrawRotation(); if( font->IsOutline() ) - cache = GetRenderCache( font, shownText, drawPos ); + cache = GetRenderCache( font, shownText, VECTOR2I() ); } else { diff --git a/eeschema/dialogs/dialog_field_properties.cpp b/eeschema/dialogs/dialog_field_properties.cpp index 7e6d612f76..d7a6c7c76a 100644 --- a/eeschema/dialogs/dialog_field_properties.cpp +++ b/eeschema/dialogs/dialog_field_properties.cpp @@ -646,7 +646,7 @@ void DIALOG_SCH_FIELD_PROPERTIES::UpdateField( SCH_COMMIT* aCommit, SCH_FIELD* a } else if( parent && parent->Type() == SCH_GLOBAL_LABEL_T ) { - if( fieldType == 0 ) + if( aField->GetCanonicalName() == wxT( "Intersheetrefs" ) ) { if( m_visible->GetValue() != parent->Schematic()->Settings().m_IntersheetRefsShow ) { diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h index 29d47f7e31..8d13e010e3 100644 --- a/eeschema/sch_field.h +++ b/eeschema/sch_field.h @@ -94,7 +94,7 @@ public: bool IsHypertext() const override { - return m_id == 0 && m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T; + return GetCanonicalName() == wxT( "Intersheetrefs" ); } void DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const override; diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index c48a1f5d31..e345ff87dc 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -1159,7 +1159,7 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const } } - text->GetEffectiveTextShape( false )->Collide( poss, closestDist, &dist ); + text->GetEffectiveTextShape( false )->Collide( poss, INT_MAX / 2, &dist ); } else if( symbol ) {