mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#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:
parent
f0be8214b0
commit
d37ed9bb7c
@ -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();
|
||||
|
@ -485,11 +485,6 @@ void CategoryLegend::layoutInfo(OverlayColorLegendLayoutInfo* layout)
|
||||
colorBarWidth,
|
||||
colorBarHeight);
|
||||
|
||||
if (layout->colorBarRect.width() < 1 || layout->colorBarRect.height() < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
layout->tickStartX = layout->margins.x();
|
||||
layout->tickMidX = layout->margins.x() + layout->colorBarRect.width();
|
||||
layout->tickEndX = layout->tickMidX + 5;
|
||||
|
@ -632,11 +632,6 @@ void OverlayScalarMapperLegend::layoutInfo(OverlayColorLegendLayoutInfo* layout)
|
||||
colorBarWidth,
|
||||
colorBarHeight);
|
||||
|
||||
if (layout->colorBarRect.width() < 1 || layout->colorBarRect.height() < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
layout->tickStartX = layout->margins.x();
|
||||
layout->tickMidX = layout->margins.x() + layout->colorBarRect.width();
|
||||
layout->tickEndX = layout->tickMidX + 5;
|
||||
|
Loading…
Reference in New Issue
Block a user