fix: smear 0 special case

This commit is contained in:
Felix Roos 2023-01-01 12:18:46 +01:00
parent 1286468d5a
commit 0abd062e5c

View File

@ -7,7 +7,7 @@ Pattern.prototype.animate = function ({ callback, sync = false, smear = 0.5 } =
window.frame && cancelAnimationFrame(window.frame);
const ctx = getDrawContext();
const { clientWidth: ww, clientHeight: wh } = ctx.canvas;
let smearPart = Number((1 - smear) * 100).toFixed(0);
let smearPart = smear === 0 ? '99' : Number((1 - smear) * 100).toFixed(0);
smearPart = smearPart.length === 1 ? `0${smearPart}` : smearPart;
clearColor = `#200010${smearPart}`;
const render = (t) => {