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
This commit is contained in:
parent
5c974f8cd0
commit
697056fa7e
|
@ -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…
Reference in New Issue