Avoid failure if existing target has no background color

This commit is contained in:
Tim Schaub
2022-01-07 14:58:46 -07:00
parent e0aa161302
commit a963ab7d1d
3 changed files with 46 additions and 4 deletions
+5 -4
View File
@@ -114,10 +114,11 @@ class CanvasLayerRenderer extends LayerRenderer {
target.style.opacity === '' &&
opacity === 1 &&
(!opt_backgroundColor ||
equals(
asArray(target.style.backgroundColor),
asArray(opt_backgroundColor)
))
(target.style.backgroundColor &&
equals(
asArray(target.style.backgroundColor),
asArray(opt_backgroundColor)
)))
) {
const canvas = target.firstElementChild;
if (canvas instanceof HTMLCanvasElement) {