Make sure rectangles are "right-side-up".
Fixes https://gitlab.com/kicad/code/kicad/issues/6023
This commit is contained in:
parent
a981ffe8c7
commit
4355e91a41
|
@ -369,8 +369,12 @@ void D_PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
|
|||
&& corners.CPoint( 2 ).y == corners.CPoint( 3 ).y
|
||||
&& corners.CPoint( 4 ).x == corners.CPoint( 0 ).x )
|
||||
{
|
||||
VECTOR2I size = corners.CPoint( 2 ) - corners.CPoint( 0 );
|
||||
add( new SHAPE_RECT( corners.CPoint( 0 ), size.x, size.y ) );
|
||||
int width = std::abs( corners.CPoint( 2 ).x - corners.CPoint( 0 ).x );
|
||||
int height = std::abs( corners.CPoint( 2 ).y - corners.CPoint( 0 ).y );
|
||||
VECTOR2I pos( std::min( corners.CPoint( 2 ).x, corners.CPoint( 0 ).x ),
|
||||
std::min( corners.CPoint( 2 ).y, corners.CPoint( 0 ).y ) );
|
||||
|
||||
add( new SHAPE_RECT( pos, width, height ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue