From 509d233d97838514e65cfff6db1cdbe2b5fc5c9c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 5 Aug 2022 23:57:37 +0100 Subject: [PATCH] Fix knockout text bounding boxes and hit testing. Fixes https://gitlab.com/kicad/code/kicad/issues/12133 --- common/eda_shape.cpp | 6 +++--- pcbnew/pcb_text.cpp | 25 ++++++++++++++++++++++++- pcbnew/pcb_text.h | 3 +++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index 0675085a3a..1ad7a2fe2d 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -781,7 +781,7 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const for( const VECTOR2I& pt : GetRectCorners() ) poly.Append( pt ); - return poly.Collide( VECTOR2I( aPosition ), maxdist ); + return poly.Collide( aPosition, maxdist ); } else // Open rect hit-test { @@ -795,9 +795,9 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const case SHAPE_T::POLY: if( IsFilled() ) - return m_poly.Collide( VECTOR2I( aPosition ), maxdist ); + return m_poly.Collide( aPosition, maxdist ); else - return m_poly.CollideEdge( VECTOR2I( aPosition ), nullptr, maxdist ); + return m_poly.CollideEdge( aPosition, nullptr, maxdist ); default: UNIMPLEMENTED_FOR( SHAPE_T_asString() ); diff --git a/pcbnew/pcb_text.cpp b/pcbnew/pcb_text.cpp index 0310b20398..724b48ff54 100644 --- a/pcbnew/pcb_text.cpp +++ b/pcbnew/pcb_text.cpp @@ -148,10 +148,22 @@ void PCB_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector