Skip to content

Commit

Permalink
Also add CanvasRenderingContext2DSettings to writeToCanvas.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Jan 22, 2024
1 parent b2d275b commit b9ed25e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/magick-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ export interface IMagickImage extends IDisposable {
* Writes the image to the specified canvas.
* @param canvas - The canvas to write the image to.
*/
writeToCanvas(canvas: HTMLCanvasElement): void;
writeToCanvas(canvas: HTMLCanvasElement, settings?: CanvasRenderingContext2DSettings): void;
}

export class MagickImage extends NativeInstance implements IMagickImage {
Expand Down Expand Up @@ -2956,11 +2956,11 @@ export class MagickImage extends NativeInstance implements IMagickImage {
return Disposable._disposeAfterExecution(array, array.func);
}

writeToCanvas(canvas: HTMLCanvasElement): void {
writeToCanvas(canvas: HTMLCanvasElement, settings?: CanvasRenderingContext2DSettings): void {
canvas.width = this.width;
canvas.height = this.height;

const ctx = canvas.getContext('2d');
const ctx = canvas.getContext('2d', settings);
if (ctx === null)
return;

Expand Down

0 comments on commit b9ed25e

Please sign in to comment.