From 62bdbd5e822937fd21e78e101ade1d3c34c2e59e Mon Sep 17 00:00:00 2001 From: Andrew <5436387+fidwell@users.noreply.github.com> Date: Sat, 20 Jul 2024 12:40:05 -0400 Subject: [PATCH] Fix window size on initialize --- src/ui/mapWindow.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui/mapWindow.ts b/src/ui/mapWindow.ts index 3c8981b..ace51ed 100644 --- a/src/ui/mapWindow.ts +++ b/src/ui/mapWindow.ts @@ -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: [ @@ -315,6 +313,7 @@ export default class MapWindow { this.window = this.createWindow(); this.initializeImage(); this.loadData(); + this.changeSize(); this.draw(); } } @@ -380,8 +379,9 @@ export default class MapWindow { if (this.window !== undefined) { const mapWidget = 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; } }