From 24f9e1c6ac1cc4acab976419c5fec4f16b2090a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Sun, 22 Mar 2020 13:29:29 +0100 Subject: [PATCH] Update comment for the IconImage replaceColor_ method --- src/ol/style/IconImage.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ol/style/IconImage.js b/src/ol/style/IconImage.js index a9739a3ed6..38ca4cda5c 100644 --- a/src/ol/style/IconImage.js +++ b/src/ol/style/IconImage.js @@ -217,10 +217,12 @@ class IconImage extends EventTarget { ctx.drawImage(this.image_, 0, 0); if (this.isTainted_(ctx)) { - // Internet explorer 11 marks canvas as tainted if the drawn image is a svg. - // This makes the getImageData function throw a SecurityError. - // The same effect can be achieved with the globalCompositionOperation but - // Internet Explorer 11 does not properly support the multiply operation. + // If reading from the canvas throws a SecurityError the same effect can be + // achieved with globalCompositeOperation. + // This could be used as the default, but it is not fully supported by all + // browsers. E. g. Internet Explorer 11 does not support the multiply + // operation and the resulting image shape will be completelly filled with + // the provided color. // So this is only used as a fallback. It is still better than having no icon // at all. const c = this.color_;