Fix graphic snapping

If the user has requested the ability to snap to graphics, we want to
add any of the graphical layers to the limit list
This commit is contained in:
Seth Hillbrand 2022-08-04 09:56:31 -07:00
parent c3b9c65fd6
commit 2cf4cb937f
3 changed files with 19 additions and 0 deletions

View File

@ -734,6 +734,19 @@ EDA_RECT FOOTPRINT::GetFpPadsLocalBbox() const
}
LSET FOOTPRINT::GetLayerSet() const
{
LSET retval;
RunOnChildren( [&retval]( BOARD_ITEM* aItem )
{
retval |= aItem->GetLayerSet();
} );
return retval;
}
const EDA_RECT FOOTPRINT::GetBoundingBox() const
{
return GetBoundingBox( true, true );

View File

@ -166,6 +166,8 @@ public:
const EDA_RECT GetBoundingBox() const override;
const EDA_RECT GetBoundingBox( bool aIncludeText, bool aIncludeInvisibleText ) const;
LSET GetLayerSet() const override;
PADS& Pads() { return m_pads; }
const PADS& Pads() const { return m_pads; }

View File

@ -756,6 +756,10 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference, bool aRe
LSET item_layers = selection.GetSelectionLayers();
bool is_hover = selection.IsHover(); // N.B. This must be saved before the second call
// to RequestSelection() below
if( editFrame->GetMagneticItemsSettings()->graphics )
item_layers |= LSET::UserDefinedLayers() | LSET::UserMask();
VECTOR2I pickedReferencePoint;
// Now filter out pads if not in free pads mode. We cannot do this in the first