check for frame before applying selection

This commit is contained in:
jfmcarreira committed 2014-10-25 01:51:03 +01:00
1 parent afdb0aed2b
commit d0ae3298e1
1 file changed
+18 -15
+18 -15
View File
@@ -491,22 +491,25 @@ Void FramePropertiesSideBar::setSelection( const QRect &selectionArea )
// This is necessary to stop computation because image.bits() is
// currently used by threaded histogram algorithm.
m_cSelectionArea = selectionArea;
if( m_pcFrame )
{
m_cSelectionArea = selectionArea;
if( selectionArea.isValid() )
{
histogramWidget->stopHistogramComputation();
histogramWidget->updateSelectionData( new PlaYUVerFrame(m_pcFrame, selectionArea));
fullImageButton->show();
selectionImageButton->show();
selectionImageButton->click();
slotRenderingChanged( HistogramWidget::ImageSelectionHistogram );
}
else
{
fullImageButton->hide();
selectionImageButton->hide();
slotRenderingChanged( HistogramWidget::FullImageHistogram );
if( selectionArea.isValid() )
{
histogramWidget->stopHistogramComputation();
histogramWidget->updateSelectionData( new PlaYUVerFrame(m_pcFrame, selectionArea));
fullImageButton->show();
selectionImageButton->show();
selectionImageButton->click();
slotRenderingChanged( HistogramWidget::ImageSelectionHistogram );
}
else
{
fullImageButton->hide();
selectionImageButton->hide();
slotRenderingChanged( HistogramWidget::FullImageHistogram );
}
}
}