summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-01 01:01:00 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-01 01:01:00 +0300
commit9f85b059aff7c54043d85c3422f02be3570d5050 (patch)
tree44d726e5a7dcff6be3b2bd20233596526b1fd9c3 /src/gui
parent4e596c5929ff5b773caeda3fcf0de9ca89602b37 (diff)
downloadmanaplus-9f85b059aff7c54043d85c3422f02be3570d5050.tar.gz
manaplus-9f85b059aff7c54043d85c3422f02be3570d5050.tar.bz2
manaplus-9f85b059aff7c54043d85c3422f02be3570d5050.tar.xz
manaplus-9f85b059aff7c54043d85c3422f02be3570d5050.zip
fix items draging grid in outfits window.
Diffstat (limited to 'src/gui')
-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;