From a5d85e328150b18bbd66b97d55b8936ad9f192a9 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 23 Feb 2023 14:15:01 -0800 Subject: [PATCH] Bitmaps are not actually copper We report bitmaps as being 'on' a copper layer because they are associated with it but they are not actually physical parts so should not be included in the DRC checks Additionally, Bitmaps effective shape starts are the top left corner rather than the center (unclear why that was there in the first place) Fixes https://gitlab.com/kicad/code/kicad/issues/14065 (cherry picked from commit 1b8b216ac88e272229c63995c66b956b316f6de4) --- pcbnew/pcb_bitmap.cpp | 2 +- pcbnew/tools/drawing_tool.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pcbnew/pcb_bitmap.cpp b/pcbnew/pcb_bitmap.cpp index 239ded025d..37d8001ade 100644 --- a/pcbnew/pcb_bitmap.cpp +++ b/pcbnew/pcb_bitmap.cpp @@ -152,7 +152,7 @@ const BOX2I PCB_BITMAP::GetBoundingBox() const std::shared_ptr PCB_BITMAP::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const { BOX2I box = GetBoundingBox(); - return std::shared_ptr( new SHAPE_RECT( box.GetCenter(), box.GetWidth(), + return std::shared_ptr( new SHAPE_RECT( box.GetPosition(), box.GetWidth(), box.GetHeight() ) ); } diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 736dd818aa..cc562addf9 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -2854,7 +2854,8 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent ) for( PCB_LAYER_ID layer : aOther->GetLayerSet().Seq() ) { - if( !IsCopperLayer( layer ) ) + // Bitmaps are "on" a copper layer but are not actually part of it + if( !IsCopperLayer( layer ) || aOther->Type() == PCB_BITMAP_T ) continue; constraint = m_drcEngine->EvalRules( CLEARANCE_CONSTRAINT, aVia, aOther, layer );