Skip to content

Commit 318c8bf

Browse files
Fix the frickin bug
1 parent 6d1078b commit 318c8bf

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Fix: [#3167] Dropdown for terrain type selection is displayed at the wrong position.
55
- Fix: [#3171] Background of station labels have a visible gap due to being off by one pixel.
66
- Fix: [#3184] The minimum size of the map window is miscalculated when it is dragged past a certain point.
7+
- Fix: [#3190] The map window's minimap isn't centred correctly when it is first opened.
78

89
25.07 (2025-07-15)
910
------------------------------------------------------------------------

src/OpenLoco/src/Ui/Windows/MapWindow.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace OpenLoco::Ui::Windows::MapWindow
103103
statusBar,
104104
};
105105

106-
static constexpr auto widgets = makeWidgets(
106+
static constexpr auto kWidgets = makeWidgets(
107107
Widgets::Frame({ 0, 0 }, { 350, 272 }, WindowColour::primary),
108108
Widgets::Caption({ 1, 1 }, { 348, 13 }, Widgets::Caption::Style::whiteText, WindowColour::primary, StringIds::title_map),
109109
Widgets::ImageButton({ 335, 2 }, { 13, 13 }, WindowColour::primary, ImageIds::close_button, StringIds::tooltip_close_window),
@@ -2415,7 +2415,7 @@ namespace OpenLoco::Ui::Windows::MapWindow
24152415
}
24162416

24172417
window = WindowManager::createWindow(WindowType::map, size, WindowFlags::none, getEvents());
2418-
window->setWidgets(widgets);
2418+
window->setWidgets(kWidgets);
24192419
window->initScrollWidgets();
24202420
window->frameNo = 0;
24212421

@@ -2473,7 +2473,7 @@ namespace OpenLoco::Ui::Windows::MapWindow
24732473
const int16_t vpCentreX = ((viewport->viewWidth / 2) + viewport->viewX) / 32;
24742474
const int16_t vpCentreY = ((viewport->viewHeight / 2) + viewport->viewY) / 16;
24752475

2476-
auto& widget = widgets[widx::scrollview];
2476+
auto& widget = window->widgets[widx::scrollview];
24772477
const int16_t miniMapWidth = widget.width() - ScrollView::barWidth;
24782478
const int16_t miniMapHeight = widget.height() - ScrollView::barWidth;
24792479

0 commit comments

Comments
 (0)