StickerSpoof: Fix not correctly cleaning previous frame
This commit is contained in:
parent
3c8084ec36
commit
c1d2f0078f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user