diff --git a/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp b/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp index 2bc3509a8f..2938eec0b3 100644 --- a/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp +++ b/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp @@ -976,11 +976,11 @@ void RimContourMapProjection::generateTrianglesWithVertexValues() std::vector clippedTriangle; if ( v == clippedPolygon.size() - 1 ) { - clippedTriangle = {clippedPolygon[v], clippedPolygon[0], baryCenter}; + clippedTriangle = { clippedPolygon[v], clippedPolygon[0], baryCenter }; } else { - clippedTriangle = {clippedPolygon[v], clippedPolygon[v + 1], baryCenter}; + clippedTriangle = { clippedPolygon[v], clippedPolygon[v + 1], baryCenter }; } polygonTriangles.push_back( clippedTriangle ); } @@ -1106,7 +1106,10 @@ void RimContourMapProjection::generateContourPolygons() if ( legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::LINEAR_DISCRETE || legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS ) { - contourLevels.front() -= 0.01 * ( contourLevels.back() - contourLevels.front() ); + const int fudgeFactor = 0.01; + // Adjust contour levels slightly to avoid weird visual artifacts due to numerical error. + contourLevels.front() -= fudgeFactor * ( contourLevels.back() - contourLevels.front() ); + contourLevels.back() += fudgeFactor * ( contourLevels.back() - contourLevels.front() ); } else {