diff options
author | alberth <alberth@openttd.org> | 2009-04-17 19:55:39 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-04-17 19:55:39 +0000 |
commit | 19d9dc583609cfe3c4c428881344a20da51665dc (patch) | |
tree | cd7841172b13ca19f98cacd2561b56a85d473adb | |
parent | 1883510be00c82cbe233340a11f32171befe18d6 (diff) | |
download | openttd-19d9dc583609cfe3c4c428881344a20da51665dc.tar.xz |
(svn r16073) -Codechange: Replacing some magic constants by computations relative to the SLW_PANEL widget.
-rw-r--r-- | src/subsidy_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index aa61d0d3e..bfa233605 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -37,7 +37,7 @@ struct SubsidyListWindow : Window { { if (widget != SLW_PANEL) return; - int y = pt.y - 25; + int y = pt.y - this->widget[SLW_PANEL].top - FONT_HEIGHT_NORMAL - 1; // Skip 'subsidies on offer' line if (y < 0) return; @@ -117,9 +117,9 @@ struct SubsidyListWindow : Window { ConvertDateToYMD(_date, &ymd); - int right = this->width - 12; // scroll bar = 11 + pixel each side - int y = 15; - int x = 1; + int right = this->widget[SLW_PANEL].right; + int y = this->widget[SLW_PANEL].top + 1; + int x = this->widget[SLW_PANEL].left + 1; /* Section for drawing the offered subisidies */ DrawString(x, right, y, STR_2026_SUBSIDIES_ON_OFFER_FOR, TC_FROMSTRING); |