Corrected VIEW::ToScreen().

This commit is contained in:
Maciej Suminski 2015-07-01 03:22:50 +02:00
parent 377942ed2a
commit 6ad6f0bde2
2 changed files with 7 additions and 8 deletions

View File

@ -234,11 +234,11 @@ VECTOR2D VIEW::ToScreen( const VECTOR2D& aCoord, bool aAbsolute ) const
} }
double VIEW::ToScreen( double aCoord, bool aAbsolute ) const double VIEW::ToScreen( double aSize ) const
{ {
VECTOR2D t( aCoord, 0 ); const MATRIX3x3D& matrix = m_gal->GetWorldScreenMatrix();
return ToScreen( t, aAbsolute ).x; return matrix.GetScale().x * aSize;
} }
@ -278,7 +278,7 @@ BOX2D VIEW::GetViewport() const
void VIEW::SetViewport( const BOX2D& aViewport ) void VIEW::SetViewport( const BOX2D& aViewport )
{ {
VECTOR2D ssize = ToWorld( m_gal->GetScreenPixelSize(), false ); VECTOR2D ssize = ToWorld( m_gal->GetScreenPixelSize(), false );
wxASSERT( ssize.x > 0 && ssize.y > 0 ); wxASSERT( ssize.x > 0 && ssize.y > 0 );

View File

@ -282,11 +282,10 @@ public:
/** /**
* Function ToScreen() * Function ToScreen()
* Converts a world space coordinate to a coordinate in screen space coordinates. * Converts a world space one dimensionsal size to a one dimensional size in screen space.
* @param aCoord: the coordinate to be transformed. * @param aCoord: the size to be transformed.
* @param aAbsolute: when true, aCoord is treated as a point, otherwise - as a direction (vector)
*/ */
double ToScreen( double aCoord, bool aAbsolute = true ) const; double ToScreen( double aSize ) const;
/** /**
* Function GetScreenPixelSize() * Function GetScreenPixelSize()