Nullptr safety.

This commit is contained in:
Jeff Young 2023-02-20 14:02:08 +00:00
parent 87eb4401e3
commit ae0cf19923
1 changed files with 4 additions and 4 deletions

View File

@ -3579,23 +3579,23 @@ void mpFXY::UpdateScales()
double mpFXY::s2x( double plotCoordX ) const
{
return m_scaleX->TransformFromPlot( plotCoordX );
return m_scaleX ? m_scaleX->TransformFromPlot( plotCoordX ) : plotCoordX;
}
double mpFXY::s2y( double plotCoordY ) const
{
return m_scaleY->TransformFromPlot( plotCoordY );
return m_scaleY ? m_scaleY->TransformFromPlot( plotCoordY ) : plotCoordY;
}
double mpFXY::x2s( double x ) const
{
return m_scaleX->TransformToPlot( x );
return m_scaleX ? m_scaleX->TransformToPlot( x ) : x;
}
double mpFXY::y2s( double y ) const
{
return m_scaleY->TransformToPlot( y );
return m_scaleY ? m_scaleY->TransformToPlot( y ) : y;
}