Commit 8c1dd139 authored by Andrew Zonenberg's avatar Andrew Zonenberg

Fixed divide-by-zero in D_PAD::ViewGetLOD()

parent 37757b52
......@@ -965,6 +965,11 @@ unsigned int D_PAD::ViewGetLOD( int aLayer ) const
// Netnames will be shown only if zoom is appropriate
if( IsNetnameLayer( aLayer ) )
{
// Pad sizes can be zero briefly when someone is typing a number like "0.5" in the pad properties dialog.
// Fail gracefully if this happens.
if( (m_Size.x == 0) && (m_Size.y == 0) )
return UINT_MAX;
return ( 100000000 / std::max( m_Size.x, m_Size.y ) );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment