From 9f85b059aff7c54043d85c3422f02be3570d5050 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 1 Jun 2013 01:01:00 +0300 Subject: fix items draging grid in outfits window. --- src/gui/outfitwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui') 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(OUTFIT_ITEM_COUNT) || index < 0) return -1; return index; -- cgit v1.2.3-70-g09d2