summaryrefslogtreecommitdiff
path: root/src/music_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-07-26 13:02:28 +0000
committeralberth <alberth@openttd.org>2010-07-26 13:02:28 +0000
commit3a1451644a0eae226545818adbde8a8a8c45eab7 (patch)
tree130026ba4b8d6f2d094d756f434671a4cbc52569 /src/music_gui.cpp
parent80cc566553ca1eb33566e0b05a49b7112d98718d (diff)
downloadopenttd-3a1451644a0eae226545818adbde8a8a8c45eab7.tar.xz
(svn r20221) -Codechange: Move unscrolled row calculation into a function.
Diffstat (limited to 'src/music_gui.cpp')
-rw-r--r--src/music_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/music_gui.cpp b/src/music_gui.cpp
index c141f4e1f..380ba09ce 100644
--- a/src/music_gui.cpp
+++ b/src/music_gui.cpp
@@ -401,7 +401,7 @@ struct MusicTrackSelectionWindow : public Window {
{
switch (widget) {
case MTSW_LIST_LEFT: { // add to playlist
- int y = (pt.y - this->GetWidget<NWidgetBase>(widget)->pos_y) / FONT_HEIGHT_SMALL;
+ int y = this->GetRowFromWidget(pt.y, widget, 0, FONT_HEIGHT_SMALL);
if (msf.playlist < 4) return;
if (!IsInsideMM(y, 0, BaseMusic::GetUsedSet()->num_available)) return;
@@ -425,7 +425,7 @@ struct MusicTrackSelectionWindow : public Window {
} break;
case MTSW_LIST_RIGHT: { // remove from playlist
- int y = (pt.y - this->GetWidget<NWidgetBase>(widget)->pos_y) / FONT_HEIGHT_SMALL;
+ int y = this->GetRowFromWidget(pt.y, widget, 0, FONT_HEIGHT_SMALL);
if (msf.playlist < 4) return;
if (!IsInsideMM(y, 0, NUM_SONGS_PLAYLIST)) return;