Update backgrounds when function returns a different color
This commit is contained in:
@@ -155,7 +155,8 @@ class CanvasLayerRenderer extends LayerRenderer {
|
||||
target.style.opacity === '' &&
|
||||
opacity === 1 &&
|
||||
(!opt_backgroundColor ||
|
||||
(target.style.backgroundColor &&
|
||||
(target &&
|
||||
target.style.backgroundColor &&
|
||||
equals(
|
||||
asArray(target.style.backgroundColor),
|
||||
asArray(opt_backgroundColor)
|
||||
@@ -184,9 +185,6 @@ class CanvasLayerRenderer extends LayerRenderer {
|
||||
style.position = 'absolute';
|
||||
style.width = '100%';
|
||||
style.height = '100%';
|
||||
if (opt_backgroundColor) {
|
||||
style.backgroundColor = opt_backgroundColor;
|
||||
}
|
||||
context = createCanvasContext2D();
|
||||
const canvas = context.canvas;
|
||||
container.appendChild(canvas);
|
||||
@@ -197,6 +195,13 @@ class CanvasLayerRenderer extends LayerRenderer {
|
||||
this.container = container;
|
||||
this.context = context;
|
||||
}
|
||||
if (
|
||||
!this.containerReused &&
|
||||
opt_backgroundColor &&
|
||||
!this.container.style.backgroundColor
|
||||
) {
|
||||
this.container.style.backgroundColor = opt_backgroundColor;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user