From 24d049c017c6436716db29aa93b4008e7e00a620 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 13 Jun 2022 16:43:53 +0200 Subject: [PATCH] Fix bounding box of text in footprint not properly rotated in 6.0.5 stable version It is fixed in Master branch, so apply a fix similar to b6e8beb3 from master Fixes #8728 https://gitlab.com/kicad/code/kicad/issues/8728 --- pcbnew/fp_text.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pcbnew/fp_text.cpp b/pcbnew/fp_text.cpp index 6f8e2e83b3..7733467e64 100644 --- a/pcbnew/fp_text.cpp +++ b/pcbnew/fp_text.cpp @@ -476,7 +476,16 @@ void FP_TEXT::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffe bool aIgnoreLineWidth ) const { SHAPE_POLY_SET buffer; - EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon( &buffer, aClearance ); + FP_TEXT dummy( *this ); + + // Take parent footprint in account: + const FOOTPRINT* parentFootprint = static_cast( m_parent ); + + if( parentFootprint ) + dummy.SetTextAngle( GetTextAngle() + parentFootprint->GetOrientation() ); + + dummy.EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon( &buffer, aClearance ); + aCornerBuffer.Append( buffer ); }