summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/outfitwindow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp
index e9274e2cd..2b9f57825 100644
--- a/src/gui/outfitwindow.cpp
+++ b/src/gui/outfitwindow.cpp
@@ -506,11 +506,11 @@ void OutfitWindow::mouseReleased(gcn::MouseEvent &event)
int OutfitWindow::getIndexFromGrid(const int pointX, const int pointY) const
{
const gcn::Rectangle tRect = gcn::Rectangle(
- 10, 25, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight);
+ mPadding, mTitleBarHeight, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight);
if (!tRect.isPointInRect(pointX, pointY))
return -1;
- const int index = (((pointY - 25) / mBoxHeight) * mGridWidth) +
- (pointX - 10) / mBoxWidth;
+ const int index = (((pointY - mTitleBarHeight) / mBoxHeight) * mGridWidth) +
+ (pointX - mPadding) / mBoxWidth;
if (index >= static_cast<int>(OUTFIT_ITEM_COUNT) || index < 0)
return -1;
return index;