Skip to content

Commit 62bdbd5

Browse files
committed
Fix window size on initialize
1 parent 5137de0 commit 62bdbd5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/ui/mapWindow.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,6 @@ export default class MapWindow {
273273
title: `${Environment.pluginName} (v${Environment.pluginVersion})`,
274274
width: this.margin * 2 + mapWidgetWidth,
275275
height: mapWidget.y + mapWidget.height + this.margin,
276-
maxHeight: 10000,
277-
maxWidth: 10000,
278276
minHeight: mapWidget.y + mapWidget.height + this.margin,
279277
minWidth: btnShowPeeps.x + btnShowPeeps.width + this.margin,
280278
widgets: [
@@ -315,6 +313,7 @@ export default class MapWindow {
315313
this.window = this.createWindow();
316314
this.initializeImage();
317315
this.loadData();
316+
this.changeSize();
318317
this.draw();
319318
}
320319
}
@@ -380,8 +379,9 @@ export default class MapWindow {
380379

381380
if (this.window !== undefined) {
382381
const mapWidget = <ButtonWidget>this.window.findWidget("mapWidget");
383-
mapWidget.width = this.mapWidth * this.tileSize;
384-
mapWidget.height = this.mapHeight * this.tileSize;
382+
const isRotated = this.rotation % 2 !== 0;
383+
mapWidget.width = this.tileSize * (isRotated ? this.mapHeight : this.mapWidth);
384+
mapWidget.height = this.tileSize * (isRotated ? this.mapWidth : this.mapHeight);
385385
mapWidget.image = this.mapImageId ?? 0;
386386
}
387387
}

0 commit comments

Comments
 (0)