summaryrefslogtreecommitdiff
path: root/src/road_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/road_gui.cpp')
-rw-r--r--src/road_gui.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index a44ed3a5e..03267323b 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -972,8 +972,10 @@ struct BuildRoadStationWindow : public PickerWindowBase {
int bottom = back_nwi->pos_y + back_nwi->current_y;
top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, sct, rad, false) + WD_PAR_VSEP_NORMAL;
top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, sct, rad, true) + WD_PAR_VSEP_NORMAL;
- /* Resize background if the text is not equally long as the window. */
- if (top > bottom || (top < bottom && back_nwi->current_y > back_nwi->smallest_y)) {
+ /* Resize background if the window is too small.
+ * Never make the window smaller to avoid oscillating if the size change affects the acceptance.
+ * (This is the case, if making the window bigger moves the mouse into the window.) */
+ if (top > bottom) {
ResizeWindow(this, 0, top - bottom);
}
}