Skip to content

Commit 2d10ff9

Browse files
committed
Update canvas context type
1 parent 0188c31 commit 2d10ff9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class RawImage {
142142
throw new Error('fromCanvas() is only supported in browser environments.')
143143
}
144144

145-
const ctx = canvas.getContext('2d');
145+
const ctx = /** @type {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} */ (canvas.getContext('2d'));
146146
const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
147147
return new RawImage(data, canvas.width, canvas.height, 4);
148148
}

0 commit comments

Comments
 (0)