mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#11334 Fix cvf::Viewport assert triggered for small contour map/2d intersection
Size of the overlay is could become negative, and would overflow for small views. Fixes #11334.
This commit is contained in:
parent
df0a86f076
commit
3f3b5a621d
@ -790,7 +790,7 @@ void RiuViewer::updateLegendLayout()
|
|||||||
{
|
{
|
||||||
int legendWidth = prefSize.x();
|
int legendWidth = prefSize.x();
|
||||||
legend->setLayoutFixedPosition( cvf::Vec2i( xPos, yPos ) );
|
legend->setLayoutFixedPosition( cvf::Vec2i( xPos, yPos ) );
|
||||||
legend->setRenderSize( cvf::Vec2ui( legendWidth, viewPortHeight - 2 * border - 2 * edgeAxisBorderHeight ) );
|
legend->setRenderSize( cvf::Vec2ui( legendWidth, std::max( 0, viewPortHeight - 2 * border - 2 * edgeAxisBorderHeight ) ) );
|
||||||
xPos += legendWidth + border;
|
xPos += legendWidth + border;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -858,7 +858,7 @@ void RiuViewer::updateLegendLayout()
|
|||||||
{
|
{
|
||||||
int legendWidth = prefSize.x();
|
int legendWidth = prefSize.x();
|
||||||
legend->setLayoutFixedPosition( cvf::Vec2i( xPos - legendWidth, yPos ) );
|
legend->setLayoutFixedPosition( cvf::Vec2i( xPos - legendWidth, yPos ) );
|
||||||
legend->setRenderSize( cvf::Vec2ui( legendWidth, viewPortHeight - yPosStart - border - edgeAxisBorderHeight ) );
|
legend->setRenderSize( cvf::Vec2ui( legendWidth, std::max( 0, viewPortHeight - yPosStart - border - edgeAxisBorderHeight ) ) );
|
||||||
xPos -= legendWidth + border;
|
xPos -= legendWidth + border;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user