mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 19:48:31 +00:00
fix: smear 0 special case
This commit is contained in:
parent
1286468d5a
commit
0abd062e5c
@ -7,7 +7,7 @@ Pattern.prototype.animate = function ({ callback, sync = false, smear = 0.5 } =
|
|||||||
window.frame && cancelAnimationFrame(window.frame);
|
window.frame && cancelAnimationFrame(window.frame);
|
||||||
const ctx = getDrawContext();
|
const ctx = getDrawContext();
|
||||||
const { clientWidth: ww, clientHeight: wh } = ctx.canvas;
|
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;
|
smearPart = smearPart.length === 1 ? `0${smearPart}` : smearPart;
|
||||||
clearColor = `#200010${smearPart}`;
|
clearColor = `#200010${smearPart}`;
|
||||||
const render = (t) => {
|
const render = (t) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user