summaryrefslogtreecommitdiff
path: root/src/widgets/dropdown.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2009-03-28 12:47:29 +0000
committerpeter1138 <peter1138@openttd.org>2009-03-28 12:47:29 +0000
commitf30f5607e33e47ca9a9fca1250a13c02d7bdb931 (patch)
tree49ca20a424ccfa5b1af7564accac39aa451c605b /src/widgets/dropdown.cpp
parent1d9c362dda233bb22919e43bdf23a2bdf265eb73 (diff)
downloadopenttd-f30f5607e33e47ca9a9fca1250a13c02d7bdb931.tar.xz
(svn r15877) -Codechange: Let drop down lists know about font height.
Diffstat (limited to 'src/widgets/dropdown.cpp')
-rw-r--r--src/widgets/dropdown.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp
index c3eaa7d35..bfe66ab43 100644
--- a/src/widgets/dropdown.cpp
+++ b/src/widgets/dropdown.cpp
@@ -17,8 +17,9 @@ void DropDownListItem::Draw(int left, int right, int top, int bottom, bool sel,
int c1 = _colour_gradient[bg_colour][3];
int c2 = _colour_gradient[bg_colour][7];
- GfxFillRect(left + 1, top + 3, right - 1, top + 3, c1);
- GfxFillRect(left + 1, top + 4, right - 1, top + 4, c2);
+ int mid = top + this->Height(0) / 2;
+ GfxFillRect(left + 1, mid - 2, right - 1, mid - 2, c1);
+ GfxFillRect(left + 1, mid - 1, right - 1, mid - 1, c2);
}
uint DropDownListStringItem::Width() const