diff options
author | Vendicated <vendicated@riseup.net> | 2022-11-09 20:29:35 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-11-09 20:29:35 +0100 |
commit | c1d2f0078fe1ff154243e8483b4267d647849d13 (patch) | |
tree | 54be02d4085fbcf247291465a040631ba7dd4d0c /src | |
parent | 3c8084ec36b82fdf7ea89aaf6558197d9c070ca9 (diff) | |
download | Vencord-c1d2f0078fe1ff154243e8483b4267d647849d13.tar.gz Vencord-c1d2f0078fe1ff154243e8483b4267d647849d13.tar.bz2 Vencord-c1d2f0078fe1ff154243e8483b4267d647849d13.zip |
StickerSpoof: Fix not correctly cleaning previous frame
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/nitroBypass.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/nitroBypass.ts b/src/plugins/nitroBypass.ts index 9e961a2..937b8d0 100644 --- a/src/plugins/nitroBypass.ts +++ b/src/plugins/nitroBypass.ts @@ -181,9 +181,6 @@ export default definePlugin({ let lastImg: HTMLImageElement | null = null; for (const { left, top, width, height, disposeOp, img, delay } of frames) { - if (disposeOp === ApngDisposeOp.BACKGROUND) { - ctx.clearRect(left, top, width, height); - } ctx.drawImage(img, left, top, width, height); const { data } = ctx.getImageData(0, 0, resolution, resolution); @@ -197,9 +194,12 @@ export default definePlugin({ delay, }); - if (disposeOp === ApngDisposeOp.PREVIOUS && lastImg) { + if (disposeOp === ApngDisposeOp.BACKGROUND) { + ctx.clearRect(left, top, width, height); + } else if (disposeOp === ApngDisposeOp.PREVIOUS && lastImg) { ctx.drawImage(lastImg, left, top, width, height); } + lastImg = img; } |