Fix ToVector to return world coordinates
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7002
This commit is contained in:
parent
e73b852c2a
commit
31dd04fa96
|
@ -276,22 +276,20 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ToVector()
|
* @return a unit vector in world coordinate system corresponding to our direction.
|
||||||
*
|
|
||||||
* Returns a unit vector corresponding to our direction.
|
|
||||||
*/
|
*/
|
||||||
const VECTOR2I ToVector() const
|
const VECTOR2I ToVector() const
|
||||||
{
|
{
|
||||||
switch( m_dir )
|
switch( m_dir )
|
||||||
{
|
{
|
||||||
case N: return VECTOR2I( 0, 1 );
|
case N: return VECTOR2I( 0, -1 );
|
||||||
case S: return VECTOR2I( 0, -1 );
|
case S: return VECTOR2I( 0, 1 );
|
||||||
case E: return VECTOR2I( 1, 0 );
|
case E: return VECTOR2I( 1, 0 );
|
||||||
case W: return VECTOR2I( -1, 0 );
|
case W: return VECTOR2I( -1, 0 );
|
||||||
case NE: return VECTOR2I( 1, 1 );
|
case NE: return VECTOR2I( 1, -1 );
|
||||||
case NW: return VECTOR2I( -1, 1 );
|
case NW: return VECTOR2I( -1, -1 );
|
||||||
case SE: return VECTOR2I( 1, -1 );
|
case SE: return VECTOR2I( 1, 1 );
|
||||||
case SW: return VECTOR2I( -1, -1 );
|
case SW: return VECTOR2I( -1, 1 );
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return VECTOR2I( 0, 0 );
|
return VECTOR2I( 0, 0 );
|
||||||
|
|
Loading…
Reference in New Issue