Skip to content

Commit

Permalink
fix: Added default value to Canvas constructor (#3094)
Browse files Browse the repository at this point in the history
The combined type for the constructor property has no required fields. This way you don't have to add an empty object to the superclass's constructor when, for example, creating a Canvas subclass
  • Loading branch information
Autsider666 authored Jun 11, 2024
1 parent 436d3b1 commit c76d4fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engine/Graphics/Canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class Canvas extends Raster {
return this._ctx;
}

constructor(private _options: GraphicOptions & RasterOptions & CanvasOptions) {
constructor(private _options: GraphicOptions & RasterOptions & CanvasOptions = {}) {
super(_options);
}

Expand Down

0 comments on commit c76d4fe

Please sign in to comment.