From 8048bed1e902feba8c623f68badbba946b0a24ac Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 21 Oct 2012 14:27:21 +0300 Subject: Fix selection in skills dialog. Was broken after adding additinal theming to listboxes. --- src/gui/skilldialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index d7b3153dd..08a98db66 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -167,10 +167,10 @@ class SkillListBox final : public ListBox if (!viewport) return; - const int y = event.getY() / getRowHeight(); + const int y = (event.getY() + mPadding) / getRowHeight(); if (!mModel || y >= mModel->getNumberOfElements()) return; - const SkillInfo *const skill = mModel->getSkillAt(y + mPadding); + const SkillInfo *const skill = mModel->getSkillAt(y); if (!skill) return; -- cgit v1.2.3-70-g09d2