summaryrefslogtreecommitdiff
path: root/src/rail_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-17 18:45:00 +0000
committerrubidium <rubidium@openttd.org>2009-11-17 18:45:00 +0000
commitb9aecbf78cb193fff0ff5f4bc3264019b1df3fff (patch)
tree08ee8a00fa5d712c4d137471472fb8454562a30c /src/rail_gui.cpp
parentc6e13c6c0a42dbfaddafb6c498b346ee4e8d887c (diff)
downloadopenttd-b9aecbf78cb193fff0ff5f4bc3264019b1df3fff.tar.xz
(svn r18148) -Fix: with the waypoint picker the wrong widget was 'grayed' with RTL and the y offset of the grayed area was incorrect for big fonts
Diffstat (limited to 'src/rail_gui.cpp')
-rw-r--r--src/rail_gui.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index ebd09c26b..136ffc330 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -1820,14 +1820,15 @@ struct BuildRailWaypointWindow : PickerWindowBase {
for (uint i = 0; i < this->hscroll.GetCapacity(); i++) {
if (this->hscroll.GetPosition() + i < this->hscroll.GetCount()) {
const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, this->hscroll.GetPosition() + i);
+ NWidgetBase *nw = this->GetWidget<NWidgetBase>(BRWW_WAYPOINT_1 + i);
- int bottom = this->GetWidget<NWidgetBase>(BRWW_WAYPOINT_1 + i)->pos_y + this->GetWidget<NWidgetBase>(BRWW_WAYPOINT_1 + i)->current_y;
- DrawWaypointSprite(this->GetWidget<NWidgetBase>(BRWW_WAYPOINT_1 + i)->pos_x + TILE_PIXELS, bottom - TILE_PIXELS, this->hscroll.GetPosition() + i, _cur_railtype);
+ int bottom = nw->pos_y + nw->current_y;
+ DrawWaypointSprite(nw->pos_x + TILE_PIXELS, bottom - TILE_PIXELS, this->hscroll.GetPosition() + i, _cur_railtype);
if (statspec != NULL &&
HasBit(statspec->callback_mask, CBM_STATION_AVAIL) &&
GB(GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE), 0, 8) == 0) {
- GfxFillRect(4 + i * 68, 18, 67 + i * 68, 75, 0, FILLRECT_CHECKER);
+ GfxFillRect(nw->pos_x + 1, nw->pos_y + 1, nw->pos_x + nw->current_x - 2, bottom - 2, 0, FILLRECT_CHECKER);
}
}
}