diff --git a/pcbnew/tools/pcb_grid_helper.cpp b/pcbnew/tools/pcb_grid_helper.cpp index 801d9d287e..5a35653e53 100644 --- a/pcbnew/tools/pcb_grid_helper.cpp +++ b/pcbnew/tools/pcb_grid_helper.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2014 CERN - * Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors. * @author Tomasz Wlostowski * * This program is free software; you can redistribute it and/or @@ -683,6 +683,24 @@ void PCB_GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos break; } + case PCB_FP_ZONE_T: + { + const SHAPE_POLY_SET* outline = static_cast( aItem )->Outline(); + + SHAPE_LINE_CHAIN lc; + lc.SetClosed( true ); + + for( auto iter = outline->CIterateWithHoles(); iter; iter++ ) + { + addAnchor( *iter, CORNER, aItem ); + lc.Append( *iter ); + } + + addAnchor( lc.NearestPoint( aRefPos ), OUTLINE, aItem ); + + break; + } + case PCB_DIM_ALIGNED_T: case PCB_DIM_ORTHOGONAL_T: {