From 33dbe92deb1feab1eaed20c1563dea9e62d0c710 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 8 Jan 2022 10:49:47 +0100 Subject: [PATCH] drc_test_provider_mechanical_clearance: add missing handling of SHAPE_T::RECT test_ee_item.cpp: add missing call to ClearFieldsAutoplaced(); --- .../drc/drc_test_provider_mechanical_clearance.cpp | 14 ++++++++++++++ qa/eeschema/test_ee_item.cpp | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pcbnew/drc/drc_test_provider_mechanical_clearance.cpp b/pcbnew/drc/drc_test_provider_mechanical_clearance.cpp index 4963b74e92..0c455f2217 100644 --- a/pcbnew/drc/drc_test_provider_mechanical_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_mechanical_clearance.cpp @@ -337,6 +337,20 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::Run() break; } + case SHAPE_T::RECT: + { + SHAPE_LINE_CHAIN asPoly; + std::vector pts = shape->GetRectCorners(); + asPoly.Append( pts[0] ); + asPoly.Append( pts[1] ); + asPoly.Append( pts[2] ); + asPoly.Append( pts[3] ); + asPoly.SetClosed( true ); + + testShapeLineChain( asPoly, shape->GetWidth(), layer, item, c ); + break; + } + default: UNIMPLEMENTED_FOR( shape->SHAPE_T_asString() ); } diff --git a/qa/eeschema/test_ee_item.cpp b/qa/eeschema/test_ee_item.cpp index 575a46c5de..9534e7cfc3 100644 --- a/qa/eeschema/test_ee_item.cpp +++ b/qa/eeschema/test_ee_item.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2021 KiCad Developers, see AUTHORS.TXT for contributors. + * Copyright (C) 2022 KiCad Developers, see AUTHORS.TXT for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -244,6 +244,7 @@ BOOST_AUTO_TEST_CASE( Rotate ) if( schItem != nullptr ) { + schItem->ClearFieldsAutoplaced(); schItem->Rotate( aRef ); schItem->Rotate( aRef ); schItem->Rotate( aRef );