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
(cherry picked from commit 697056fa7e
)
This commit is contained in:
parent
535982f245
commit
61cfe53be1
|
@ -244,7 +244,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignBottom( const TOOL_EVENT& aEvent )
|
||||||
if( !GetSelections( itemsToAlign, locked_items,
|
if( !GetSelections( itemsToAlign, locked_items,
|
||||||
[]( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right)
|
[]( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right)
|
||||||
{
|
{
|
||||||
return ( left.second.GetBottom() < right.second.GetBottom() );
|
return ( left.second.GetBottom() > right.second.GetBottom() );
|
||||||
} ) )
|
} ) )
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -364,7 +364,7 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignRight()
|
||||||
if( !GetSelections( itemsToAlign, locked_items,
|
if( !GetSelections( itemsToAlign, locked_items,
|
||||||
[]( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right)
|
[]( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right)
|
||||||
{
|
{
|
||||||
return ( left.second.GetRight() < right.second.GetRight() );
|
return ( left.second.GetRight() > right.second.GetRight() );
|
||||||
} ) )
|
} ) )
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue