Skip to content

Commit

Permalink
Added early exit for empty drawables.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Feb 9, 2024
1 parent 9b4fc7e commit abc6ede
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/magick-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2371,8 +2371,12 @@ export class MagickImage extends NativeInstance implements IMagickImage {
draw(drawables: IDrawable[]): void;
draw(...drawables: IDrawable[]): void;
draw(...drawables: IDrawable[][] | IDrawable[]): void {
const items = drawables.flat();
if (items.length === 0)
return;

DrawingWand._use(this, (wand) => {
wand.draw(drawables.flat());
wand.draw(items);
});
}

Expand Down

0 comments on commit abc6ede

Please sign in to comment.