fix linter errors, reformat
This commit is contained in:
parent
1ba396bc7c
commit
0982857082
1 changed files with 36 additions and 19 deletions
|
@ -1,5 +1,8 @@
|
|||
import { CollageModes, CollageModeType, collageModeType } from "../src/common/collages.ts";
|
||||
import { CanvasRenderingContext2D, createCanvas, Image, ImageBitmap, loadImage } from "https://deno.land/x/canvas/mod.ts";
|
||||
import { CollageModes } from "../src/common/collages.ts";
|
||||
import {
|
||||
CanvasRenderingContext2D,
|
||||
Image,
|
||||
} from "https://deno.land/x/canvas/mod.ts";
|
||||
import { CollageContext, CollageImage } from "../src/common/types.ts";
|
||||
|
||||
export class ProxyImage implements CollageImage {
|
||||
|
@ -18,10 +21,24 @@ export class ProxyImage implements CollageImage {
|
|||
}
|
||||
}
|
||||
|
||||
export type CastCanvasRenderingContext = CanvasRenderingContext2D & CollageContext;
|
||||
export type CastCanvasRenderingContext =
|
||||
& CanvasRenderingContext2D
|
||||
& CollageContext;
|
||||
|
||||
export default class BrowserCollageModes extends CollageModes<CastCanvasRenderingContext, ProxyImage> {
|
||||
drawImage(ctx: CastCanvasRenderingContext, image: ProxyImage, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void {
|
||||
export default class BrowserCollageModes
|
||||
extends CollageModes<CastCanvasRenderingContext, ProxyImage> {
|
||||
drawImage(
|
||||
ctx: CastCanvasRenderingContext,
|
||||
image: ProxyImage,
|
||||
sx: number,
|
||||
sy: number,
|
||||
sw: number,
|
||||
sh: number,
|
||||
dx: number,
|
||||
dy: number,
|
||||
dw: number,
|
||||
dh: number,
|
||||
): void {
|
||||
ctx.drawImage(image.get(), sx, sy, sw, sh, dx, dy, dw, dh);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue