From 3643f9ec98298c8aa8aa071844295f25fd3a7e55 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Thu, 30 Apr 2020 13:04:30 +0100 Subject: [PATCH] Use BrokenDiagonalRendering with contextOptions Apply the BrokenDiagonalRendering processing if opt_contextOptions is set to avoid color distortion along reprojection edges --- src/ol/reproj.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/reproj.js b/src/ol/reproj.js index 274f732ff3..6a511bf04d 100644 --- a/src/ol/reproj.js +++ b/src/ol/reproj.js @@ -1,7 +1,7 @@ /** * @module ol/reproj */ -import {assign} from './obj.js'; +import {assign, isEmpty} from './obj.js'; import { containsCoordinate, createEmpty, @@ -330,7 +330,7 @@ export function render( context.save(); context.beginPath(); - if (isBrokenDiagonalRendering()) { + if (isBrokenDiagonalRendering() || !isEmpty(opt_contextOptions)) { // Make sure that everything is on pixel boundaries const u0r = pixelRound(u0); const v0r = pixelRound(v0);