diff --git a/src/context2d.ts b/src/context2d.ts index a288351..8ae86ba 100644 --- a/src/context2d.ts +++ b/src/context2d.ts @@ -1066,7 +1066,7 @@ export class CanvasRenderingContext2D { throw new Error("getImageData is only supported on Canvas"); } const data = new Uint8Array(sw * sh * 4); - this[_canvas].readPixels(sx, sy, sh, sh, data, "srgb"); + this[_canvas].readPixels(sx, sy, sw, sh, data, "srgb"); return new ImageData(data, sw, sh); }