From 286b15ee82d22d388d9d98035e3cf1ea3f02814d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Jan 2023 01:29:49 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_static/upload.svg | 2 +- src/main.ts | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/_static/upload.svg b/src/_static/upload.svg index 91eaff7..d472533 100644 --- a/src/_static/upload.svg +++ b/src/_static/upload.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/main.ts b/src/main.ts index aad5f9d..88d1027 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,7 +7,7 @@ function arrayToCsv(data: number[][]): string { row .map(String) // convert every value to String .map((v) => `"${v}"`) // quote it - .join(',') // comma-separated + .join(','), // comma-separated ) .join('\n'); // rows starting on new lines } @@ -28,7 +28,7 @@ class DrawingApp { constructor() { this.imgCanvas = document.getElementById('imgCanvas') as HTMLCanvasElement; this.pointCanvas = document.getElementById( - 'pointCanvas' + 'pointCanvas', ) as HTMLCanvasElement; this.imgContext = this.imgCanvas.getContext('2d'); this.pointContext = this.pointCanvas.getContext('2d'); @@ -81,7 +81,9 @@ class DrawingApp { document.getElementById('csv-save').addEventListener('click', () => { const url = URL.createObjectURL( - new Blob([arrayToCsv(this.clicks)], { type: 'text/csv;charset=utf-8;' }) + new Blob([arrayToCsv(this.clicks)], { + type: 'text/csv;charset=utf-8;', + }), ); // Create a link to download it @@ -133,7 +135,7 @@ class DrawingApp { shiftX, shiftY, img.width * ratio, - img.height * ratio + img.height * ratio, ); } @@ -142,7 +144,7 @@ class DrawingApp { 0, 0, this.pointCanvas.width, - this.pointCanvas.height + this.pointCanvas.height, ); this.clicks.map((click) => { this.drawPoint(click[0], click[1]); @@ -173,7 +175,7 @@ class DrawingApp { 0, 0, this.pointCanvas.width, - this.pointCanvas.height + this.pointCanvas.height, ); this.clicks = []; } @@ -198,7 +200,7 @@ class DrawingApp { () => { this.img.src = reader.result as string; }, - false + false, ); reader.readAsDataURL((e.target as HTMLInputElement).files[0]); };