Commit 8ca20e35 authored by André Reichenbach's avatar André Reichenbach
Browse files

[FIX] fixed infinite loop in WMHistogramView when adding the module via project file

parent 4d2c93f2
......@@ -271,9 +271,16 @@ void WMHistogramView::moduleMain()
if( m_mainNode )
{
bool dataChanged = false;
bool hasData = false;
for( std::size_t k = 0; k < m_data.size(); ++k )
{
dataChanged = dataChanged || ( m_input[ k ]->getData() && m_data[ k ] != m_input[ k ]->getData() );
hasData = hasData || ( m_input[ k ]->getData() || m_data[ k ] );
}
if( !hasData )
{
continue;
}
bool colorChanged = false;
......@@ -344,6 +351,7 @@ void WMHistogramView::moduleMain()
{
m_mainNode->remove( m_markerNode );
}
createInfo();
}
}
......@@ -857,6 +865,11 @@ void WMHistogramView::createGeometryStairs( int type )
double WMHistogramView::findOptimalSpacing( double intervalLength, double availableSpace, double textSize )
{
if( intervalLength < 0.0 )
{
throw WException( "Error in label spacing calculation!" );
}
// minimum distance of two labels in window coordinates (pixels)
double const minDistance = 2 * textSize;
......
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