#51 Avoid that legend background misses frame line on the right

This commit is contained in:
Jacob Støren 2018-03-08 16:12:40 +01:00
parent 7bd08067a9
commit 7a9e53bdb1
2 changed files with 3 additions and 3 deletions

View File

@ -187,7 +187,7 @@ void CategoryLegend::renderGeneric(OpenGLContext* oglContext,
TextDrawer textDrawer(m_font.p());
setupTextDrawer(&textDrawer, &layout, &maxLegendRightPos);
Vec2f backgroundSize(maxLegendRightPos + 3.0f, (float)size.y());
Vec2f backgroundSize(CVF_MIN(maxLegendRightPos + 3.0f, (float)size.x()), (float)size.y());
// Do the actual rendering
if (software)

View File

@ -245,8 +245,8 @@ void OverlayScalarMapperLegend::renderGeneric(OpenGLContext* oglContext, const V
float maxLegendRightPos = 0;
TextDrawer textDrawer(m_font.p());
setupTextDrawer(&textDrawer, &layout, &maxLegendRightPos);
Vec2f backgroundSize(maxLegendRightPos + 3.0f, (float)size.y());
Vec2f backgroundSize(CVF_MIN(maxLegendRightPos + 3.0f, (float)size.x()), (float)size.y());
// Do the actual rendering
if (software)