Browse Source

Correctly sort positions for default align

When not aligning under mouse cursor, choose the X-most element where X
is top/bottom/left/right.  Previous sorting was not correct for two
directions

Fixes https://gitlab.com/kicad/code/kicad/issues/12627
7.0
Seth Hillbrand 4 years ago
parent
commit
697056fa7e
  1. 4
      pcbnew/tools/placement_tool.cpp

4
pcbnew/tools/placement_tool.cpp

@ -245,7 +245,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignBottom( const TOOL_EVENT& aEvent )
if( !GetSelections( itemsToAlign, locked_items,
[]( const std::pair<BOARD_ITEM*, BOX2I> left, const std::pair<BOARD_ITEM*, BOX2I> right)
{
return ( left.second.GetBottom() < right.second.GetBottom() );
return ( left.second.GetBottom() > right.second.GetBottom() );
} ) )
{
return 0;
@ -365,7 +365,7 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignRight()
if( !GetSelections( itemsToAlign, locked_items,
[]( const std::pair<BOARD_ITEM*, BOX2I> left, const std::pair<BOARD_ITEM*, BOX2I> right)
{
return ( left.second.GetRight() < right.second.GetRight() );
return ( left.second.GetRight() > right.second.GetRight() );
} ) )
{
return 0;

Loading…
Cancel
Save