diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-04 22:39:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-04 22:39:21 +0300 |
commit | 6f0554d8c81752ec8f0e3b9822bdeb590cbdfafb (patch) | |
tree | 545e5c2064b215c6db4006653dfd580b441a1e53 /src/gui/widgets/itemcontainer.cpp | |
parent | 75bcf85c5bfa0aca83cffbdded7370c532319f0b (diff) | |
download | manaplus-6f0554d8c81752ec8f0e3b9822bdeb590cbdfafb.tar.gz manaplus-6f0554d8c81752ec8f0e3b9822bdeb590cbdfafb.tar.bz2 manaplus-6f0554d8c81752ec8f0e3b9822bdeb590cbdfafb.tar.xz manaplus-6f0554d8c81752ec8f0e3b9822bdeb590cbdfafb.zip |
Dont show popup in inventory if mouse present outside of item rectangle.
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 75ef1e852..773f43ff7 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -820,13 +820,15 @@ void ItemContainer::updateMatrix() delete sortedItems[idx]; } -int ItemContainer::getSlotIndex(const int x, const int y) const +int ItemContainer::getSlotIndex(int x, int y) const { if (!mShowMatrix) return Inventory::NO_SLOT_INDEX; if (x < mDimension.width && y < mDimension.height && x >= 0 && y >= 0) { + if (x > mBoxWidth * mGridColumns) + return Inventory::NO_SLOT_INDEX; const int idx = (y / mBoxHeight) * mGridColumns + (x / mBoxWidth); if (idx >= 0 && idx < mGridRows * mGridColumns && mShowMatrix[idx] >= 0) |