Chrome HDR artefacting fix

This commit is contained in:
Djeex
2026-08-16 22:43:02 +02:00
parent 40a01c4701
commit 193b1704f8
+8
View File
@@ -32,6 +32,14 @@ window.addEventListener("DOMContentLoaded", () => {
img.classList.add("loaded"); img.classList.add("loaded");
}; };
// Chrome HDR artefacting fix
const clearWillChange = (e) => {
if (e.propertyName !== "transform") return;
img.style.willChange = "auto";
img.removeEventListener("transitionend", clearWillChange);
};
img.addEventListener("transitionend", clearWillChange);
if (img.complete && img.naturalHeight !== 0) { if (img.complete && img.naturalHeight !== 0) {
onLoad(); // already loaded onLoad(); // already loaded
} else { } else {