#2889 Fix crash when few tick marks in legend.

Set legend title before adding to view to make size calculaltion correct first time.
This commit is contained in:
Jacob Støren
2018-05-11 13:36:08 +02:00
parent f0be8214b0
commit d37ed9bb7c
3 changed files with 2 additions and 12 deletions

View File

@@ -1087,8 +1087,8 @@ void RimEclipseView::updateLegends()
}
}
m_viewer->addColorLegendToBottomLeftCorner(this->cellEdgeResult()->legendConfig()->titledOverlayFrame());
this->cellEdgeResult()->legendConfig()->setTitle(QString("Edge Results: \n") + this->cellEdgeResult()->resultVariableUiShortName());
m_viewer->addColorLegendToBottomLeftCorner(this->cellEdgeResult()->legendConfig()->titledOverlayFrame());
}
else
{
@@ -1128,8 +1128,8 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel,
if (resultColors->hasResult() && resultColors->legendConfig()->showLegend())
{
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->titledOverlayFrame());
resultColors->legendConfig()->setTitle(legendLabel + resultColors->resultVariableUiShortName());
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->titledOverlayFrame());
}
size_t maxTimeStepCount = cellResultsData->maxTimeStepCount();