Skip to content

Commit

Permalink
Fixing lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fidwell committed Jul 19, 2022
1 parent 3a626c2 commit 83edf79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/ui/graphics.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default class Graphics {
static allocateImage(pixelData: PixelData) {
var range = ui.imageManager.allocate(1);
const range = ui.imageManager.allocate(1);
if (range) {
ui.imageManager.setPixelData(range.start, pixelData);
return range.start;
Expand Down
19 changes: 11 additions & 8 deletions src/ui/mapWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,16 @@ export default class MapWindow {
return;
}

const mapWidget = <ButtonWidget>this.window.findWidget("mapWidget");
const mapWidget = <ButtonWidget> this.window.findWidget("mapWidget");
const mapWidgetSize = this.tileSize * this.mapSize;
mapWidget.width = mapWidgetSize;
mapWidget.height = mapWidgetSize;

this.window.width = this.window.minWidth = mapWidget.x + mapWidget.width + this.margin;
this.window.height = this.window.minHeight = mapWidget.y + mapWidget.height + this.margin;
this.window.width = mapWidget.x + mapWidget.width + this.margin;
this.window.height = mapWidget.y + mapWidget.height + this.margin;

this.window.minWidth = this.window.width;
this.window.minHeight = this.window.height;

Logger.debug(`Map size changed to ${this.tileSize}`);
this.draw();
Expand All @@ -335,7 +338,7 @@ export default class MapWindow {
data: new Uint8Array(0)
});

var mapWidget = <ButtonWidget>this.window.findWidget("mapWidget");
const mapWidget = <ButtonWidget> this.window.findWidget("mapWidget");
mapWidget.width = this.mapSize * this.tileSize;
mapWidget.height = this.mapSize * this.tileSize;
mapWidget.image = this.mapImageId;
Expand All @@ -346,11 +349,11 @@ export default class MapWindow {
const rotatedMap = MapWindow.rotateMap(scaledMap, this.rotation);

const start = new Date().getTime();
Logger.debug(`Reducing map...`);
Logger.debug("Reducing map...");

const flattenedColours: number[] = [];
for (let i = 0; i < rotatedMap.length; i++) {
for (let j = 0; j < rotatedMap[i].length; j++) {
for (let i = 0; i < rotatedMap.length; i += 1) {
for (let j = 0; j < rotatedMap[i].length; j += 1) {
flattenedColours.push(rotatedMap[i][j]);
}
}
Expand All @@ -369,7 +372,7 @@ export default class MapWindow {

static rotateMap(input: number[][], rotation: number): number[][] {
const start = new Date().getTime();
Logger.debug(`Rotating map...`);
Logger.debug("Rotating map...");
const returnValue: number[][] = [];
for (let x = 0; x < input.length; x += 1) {
returnValue[x] = [];
Expand Down

0 comments on commit 83edf79

Please sign in to comment.