#2480 2d intersection view. Adjusted category legends position

This commit is contained in:
Bjørn Erik Jensen 2018-03-13 13:26:12 +01:00
parent 2fa8202332
commit 28830d3a1b

View File

@ -561,14 +561,7 @@ void RiuViewer::addColorLegendToBottomLeftCorner(cvf::OverlayItem* legend)
caf::CategoryLegend* catLegend = dynamic_cast<caf::CategoryLegend*>(legend.p());
if (catLegend)
{
if (catLegend->categoryCount() > categoryThreshold)
{
categoryLegends.push_back(catLegend);
}
else
{
catLegend->setSizeHint(cvf::Vec2ui(200, 200));
}
categoryLegends.push_back(catLegend);
}
else
{
@ -594,8 +587,15 @@ void RiuViewer::addColorLegendToBottomLeftCorner(cvf::OverlayItem* legend)
for (auto catLegend : categoryLegends)
{
catLegend->setLayoutFixedPosition(cvf::Vec2i(xPos, yPos));
catLegend->setSizeHint(cvf::Vec2ui(categoryWidth, height - 2*border - axisCrossHeight - 2*edgeAxisBorderHeight));
if (catLegend->categoryCount() > categoryThreshold)
{
catLegend->setSizeHint(cvf::Vec2ui(categoryWidth, height - 2 * border - axisCrossHeight - 2 * edgeAxisBorderHeight));
}
else
{
catLegend->setSizeHint(cvf::Vec2ui(200, 200));
}
xPos += categoryWidth + border;
}