mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05: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:
@@ -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());
|
this->cellEdgeResult()->legendConfig()->setTitle(QString("Edge Results: \n") + this->cellEdgeResult()->resultVariableUiShortName());
|
||||||
|
m_viewer->addColorLegendToBottomLeftCorner(this->cellEdgeResult()->legendConfig()->titledOverlayFrame());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1128,8 +1128,8 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel,
|
|||||||
|
|
||||||
if (resultColors->hasResult() && resultColors->legendConfig()->showLegend())
|
if (resultColors->hasResult() && resultColors->legendConfig()->showLegend())
|
||||||
{
|
{
|
||||||
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->titledOverlayFrame());
|
|
||||||
resultColors->legendConfig()->setTitle(legendLabel + resultColors->resultVariableUiShortName());
|
resultColors->legendConfig()->setTitle(legendLabel + resultColors->resultVariableUiShortName());
|
||||||
|
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->titledOverlayFrame());
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t maxTimeStepCount = cellResultsData->maxTimeStepCount();
|
size_t maxTimeStepCount = cellResultsData->maxTimeStepCount();
|
||||||
|
|||||||
@@ -485,11 +485,6 @@ void CategoryLegend::layoutInfo(OverlayColorLegendLayoutInfo* layout)
|
|||||||
colorBarWidth,
|
colorBarWidth,
|
||||||
colorBarHeight);
|
colorBarHeight);
|
||||||
|
|
||||||
if (layout->colorBarRect.width() < 1 || layout->colorBarRect.height() < 1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layout->tickStartX = layout->margins.x();
|
layout->tickStartX = layout->margins.x();
|
||||||
layout->tickMidX = layout->margins.x() + layout->colorBarRect.width();
|
layout->tickMidX = layout->margins.x() + layout->colorBarRect.width();
|
||||||
layout->tickEndX = layout->tickMidX + 5;
|
layout->tickEndX = layout->tickMidX + 5;
|
||||||
|
|||||||
@@ -632,11 +632,6 @@ void OverlayScalarMapperLegend::layoutInfo(OverlayColorLegendLayoutInfo* layout)
|
|||||||
colorBarWidth,
|
colorBarWidth,
|
||||||
colorBarHeight);
|
colorBarHeight);
|
||||||
|
|
||||||
if (layout->colorBarRect.width() < 1 || layout->colorBarRect.height() < 1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layout->tickStartX = layout->margins.x();
|
layout->tickStartX = layout->margins.x();
|
||||||
layout->tickMidX = layout->margins.x() + layout->colorBarRect.width();
|
layout->tickMidX = layout->margins.x() + layout->colorBarRect.width();
|
||||||
layout->tickEndX = layout->tickMidX + 5;
|
layout->tickEndX = layout->tickMidX + 5;
|
||||||
|
|||||||
Reference in New Issue
Block a user