diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index 0e3a111c20..3ffbcfdcfb 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -1890,6 +1890,7 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen if ( !eclipseCaseData ) return; RigCaseCellResultsData* cellResultsData = eclipseCaseData->results( this->porosityModel() ); + cellResultsData->ensureKnownResultLoaded( this->eclipseResultAddress() ); double globalMin, globalMax; double globalPosClosestToZero, globalNegClosestToZero; diff --git a/ApplicationCode/UserInterface/RiuScalarMapperLegendFrame.cpp b/ApplicationCode/UserInterface/RiuScalarMapperLegendFrame.cpp index e2be50ea9f..d6bbf0f14c 100644 --- a/ApplicationCode/UserInterface/RiuScalarMapperLegendFrame.cpp +++ b/ApplicationCode/UserInterface/RiuScalarMapperLegendFrame.cpp @@ -17,6 +17,8 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RiuScalarMapperLegendFrame.h" +#include "cvfScalarMapperDiscreteLinear.h" +#include "cvfScalarMapperDiscreteLog.h" #include "cvfString.h" #include "cvfqtUtils.h" @@ -162,8 +164,16 @@ void RiuScalarMapperLegendFrame::renderRect( QPainter* painter, const LayoutInfo int rectIndexFromBottom = rectCount() - rectIndex - 1; cvf::Color3ub startColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom] ); cvf::Color3ub endColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom + 1] ); - QColor startQColor( startColor.r(), startColor.g(), startColor.b() ); - QColor endQColor( endColor.r(), endColor.g(), endColor.b() ); + + if ( dynamic_cast( m_scalarMapper.p() ) || + dynamic_cast( m_scalarMapper.p() ) ) + { + // Do not draw gradient for discrete legends + endColor = startColor; + } + + QColor startQColor( startColor.r(), startColor.g(), startColor.b() ); + QColor endQColor( endColor.r(), endColor.g(), endColor.b() ); QRectF gradientRect( QPointF( layout.tickStartX, layout.colorBarRect.bottom() - layout.tickYPixelPos[rectIndexFromBottom] + 1 ),