summaryrefslogtreecommitdiffstats
path: root/src/renderer/runtime/view/util
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2019-12-24 20:13:47 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2019-12-24 20:28:51 +0100
commit764cd8344df2dc9b2c271d868ae193b98b829af7 (patch)
tree026b23d62d5fc7df338f880e85c26459f8be1a6a /src/renderer/runtime/view/util
parent2f77cf7b7484beb3b94900f95d61fd2685c42ac2 (diff)
downloadrpgedit-764cd8344df2dc9b2c271d868ae193b98b829af7.tar
rpgedit-764cd8344df2dc9b2c271d868ae193b98b829af7.zip
Fix lint issues
Diffstat (limited to 'src/renderer/runtime/view/util')
-rw-r--r--src/renderer/runtime/view/util/image.ts20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/renderer/runtime/view/util/image.ts b/src/renderer/runtime/view/util/image.ts
index 37c5e7f..42e7eb7 100644
--- a/src/renderer/runtime/view/util/image.ts
+++ b/src/renderer/runtime/view/util/image.ts
@@ -3,20 +3,20 @@ import { Renderer } from '../renderer/renderer';
export function loadImage(url: string): Promise<HTMLImageElement> {
return new Promise((resolve, reject) => {
const img = new Image();
- img.addEventListener('load', () => { resolve(img); });
- img.addEventListener('error', () => { reject(new Error('failed to load ' + url)); });
+ img.addEventListener('load', () => {
+ resolve(img);
+ });
+ img.addEventListener('error', () => {
+ reject(new Error('failed to load ' + url));
+ });
img.src = url;
});
}
-export function mkTexture(
- r: Renderer,
- src: HTMLCanvasElement|HTMLImageElement,
-): [WebGLTexture, [number, number]] {
+export function mkTexture(r: Renderer, src: HTMLCanvasElement | HTMLImageElement): [WebGLTexture, [number, number]] {
const gl = r.getContext();
const texture = gl.createTexture();
- if (!texture)
- throw new Error('unable to create texture');
+ if (!texture) throw new Error('unable to create texture');
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, src);
@@ -25,9 +25,7 @@ export function mkTexture(
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
- const size: [number, number] = [
- src.width / r.coordScale, src.height / r.coordScale,
- ];
+ const size: [number, number] = [src.width / r.coordScale, src.height / r.coordScale];
return [texture, size];
}