No context sharing when layer opacity is set

This commit is contained in:
Andreas Hocevar
2021-11-05 11:34:32 +01:00
parent 6e5e94a447
commit 58806aaec1
2 changed files with 3 additions and 16 deletions

View File

@@ -17,7 +17,6 @@ import {
getTopRight,
} from '../../extent.js';
import {createCanvasContext2D} from '../../dom.js';
import {cssOpacity} from '../../css.js';
/**
* @abstract
@@ -95,8 +94,9 @@ class CanvasLayerRenderer extends LayerRenderer {
let container, context;
if (
target &&
target.style.opacity === cssOpacity(opacity) &&
target.className === layerClassName
target.className === layerClassName &&
target.style.opacity === '' &&
opacity === 1
) {
const canvas = target.firstElementChild;
if (canvas instanceof HTMLCanvasElement) {