Skip to content

Commit

Permalink
Fix window size on initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
fidwell committed Jul 20, 2024
1 parent 5137de0 commit 62bdbd5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ui/mapWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ export default class MapWindow {
title: `${Environment.pluginName} (v${Environment.pluginVersion})`,
width: this.margin * 2 + mapWidgetWidth,
height: mapWidget.y + mapWidget.height + this.margin,
maxHeight: 10000,
maxWidth: 10000,
minHeight: mapWidget.y + mapWidget.height + this.margin,
minWidth: btnShowPeeps.x + btnShowPeeps.width + this.margin,
widgets: [
Expand Down Expand Up @@ -315,6 +313,7 @@ export default class MapWindow {
this.window = this.createWindow();
this.initializeImage();
this.loadData();
this.changeSize();
this.draw();
}
}
Expand Down Expand Up @@ -380,8 +379,9 @@ export default class MapWindow {

if (this.window !== undefined) {
const mapWidget = <ButtonWidget>this.window.findWidget("mapWidget");
mapWidget.width = this.mapWidth * this.tileSize;
mapWidget.height = this.mapHeight * this.tileSize;
const isRotated = this.rotation % 2 !== 0;
mapWidget.width = this.tileSize * (isRotated ? this.mapHeight : this.mapWidth);
mapWidget.height = this.tileSize * (isRotated ? this.mapWidth : this.mapHeight);
mapWidget.image = this.mapImageId ?? 0;
}
}
Expand Down

0 comments on commit 62bdbd5

Please sign in to comment.