diff --git a/as-dithered-image.js b/as-dithered-image.js index f3a05dd..e8738c6 100644 --- a/as-dithered-image.js +++ b/as-dithered-image.js @@ -87,6 +87,7 @@ class ASDitheredImage extends HTMLElement { if (oldValue === newValue) return if ((name === "src")) { + this.force_refresh_ = true this.requestUpdate() } else if (name === "crunch") { if (newValue === "auto") { @@ -95,10 +96,11 @@ class ASDitheredImage extends HTMLElement { this.crunchFactor_ = 1.0 / this.getDevicePixelRatio() } else { this.crunchFactor_ = parseInt(newValue, 10) - if (isNaN(this.crunchFactor)) { + if (isNaN(this.crunchFactor_)) { this.crunchFactor_ = this.getAutoCrunchFactor() } } + this.force_refresh_ = true this.requestUpdate() } else if (name === "alt") { this.altText = newValue; diff --git a/test.html b/test.html index 913e238..da5aef7 100644 --- a/test.html +++ b/test.html @@ -14,13 +14,27 @@ } - +

devicePixelRatio = 0

+

\ No newline at end of file