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
This commit is contained in:
Jeff Young 2023-07-10 19:31:12 +01:00
parent 8f5b7569d1
commit eedf319ba4
4 changed files with 4 additions and 4 deletions

View File

@ -919,7 +919,7 @@ std::shared_ptr<SHAPE_COMPOUND> EDA_TEXT::GetEffectiveTextShape( bool aTriangula
attrs.m_Angle = GetDrawRotation(); attrs.m_Angle = GetDrawRotation();
if( font->IsOutline() ) if( font->IsOutline() )
cache = GetRenderCache( font, shownText, drawPos ); cache = GetRenderCache( font, shownText, VECTOR2I() );
} }
else else
{ {

View File

@ -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 ) 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 ) if( m_visible->GetValue() != parent->Schematic()->Settings().m_IntersheetRefsShow )
{ {

View File

@ -94,7 +94,7 @@ public:
bool IsHypertext() const override 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; void DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const override;

View File

@ -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 ) else if( symbol )
{ {