From cd320c3b8799fe61691de49277e6a1f53fc02d76 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 24 Nov 2023 08:09:36 +0100 Subject: [PATCH] Set a fixed width for legend icons when no symbols are used --- ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp index 4ea3e892af..ba905fb0df 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp @@ -1042,7 +1042,6 @@ void RimPlotCurve::updateCurveAppearance() // Make sure the legend lines are long enough to distinguish between line types. // Standard width in Qwt is 8 which is too short. - // Use 10 and scale this by curve thickness + add space for displaying symbol. if ( m_curveAppearance->lineStyle() != RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_NONE ) { QSize legendIconSize = m_plotCurve->legendIconSize(); @@ -1053,7 +1052,7 @@ void RimPlotCurve::updateCurveAppearance() symbolWidth = symbol->boundingRect().size().width() + 2; } - int width = std::max( 10 * m_curveAppearance->lineThickness(), ( symbolWidth * 3 ) / 2 ); + int width = std::max( 20, ( symbolWidth * 3 ) / 2 ); legendIconSize.setWidth( width ); m_plotCurve->setLegendIconSize( legendIconSize );