From 1419290e7a8c589cd911ff08ee5cfdd8d9678b91 Mon Sep 17 00:00:00 2001 From: Nathan Kunicki Date: Sat, 18 Nov 2017 16:47:14 +0000 Subject: [PATCH] Lint and build in single step --- package.json | 3 +-- src/bittmappeditor.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9e59f62..4dbb7d3 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,7 @@ "version": "0.0.1", "description": "BittMapp - A monochrome bitmap editor", "scripts": { - "build": "tsc", - "lint": "tslint -c tslint.json \"src/**/*.ts\"" + "build": "tslint -c tslint.json \"src/**/*.ts\" && tsc" }, "author": "Nathan Kunicki ", "license": "MIT", diff --git a/src/bittmappeditor.ts b/src/bittmappeditor.ts index 7918f1d..dd82520 100644 --- a/src/bittmappeditor.ts +++ b/src/bittmappeditor.ts @@ -72,7 +72,7 @@ class BittMappEditor { this._context = this.canvas.getContext("2d") as CanvasRenderingContext2D; - const deviceRatio: number = window.devicePixelRatio; + const deviceRatio: number = window.devicePixelRatio || 1; const backingStoreRatio: number = (this._context as any).backingStorePixelRatio as number || 1; this._scale = deviceRatio / backingStoreRatio;