diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-01 01:01:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-01 01:01:00 +0300 |
commit | 9f85b059aff7c54043d85c3422f02be3570d5050 (patch) | |
tree | 44d726e5a7dcff6be3b2bd20233596526b1fd9c3 | |
parent | 4e596c5929ff5b773caeda3fcf0de9ca89602b37 (diff) | |
download | manaverse-9f85b059aff7c54043d85c3422f02be3570d5050.tar.gz manaverse-9f85b059aff7c54043d85c3422f02be3570d5050.tar.bz2 manaverse-9f85b059aff7c54043d85c3422f02be3570d5050.tar.xz manaverse-9f85b059aff7c54043d85c3422f02be3570d5050.zip |
fix items draging grid in outfits window.
-rw-r--r-- | src/gui/outfitwindow.cpp | 6 |
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; |