summaryrefslogtreecommitdiff
path: root/src/gui/itemcontainer.cpp
diff options
context:
space:
mode:
authorJoshua Langley <joshlangley[at]optusnet.com.au>2007-08-14 09:59:06 +0000
committerJoshua Langley <joshlangley[at]optusnet.com.au>2007-08-14 09:59:06 +0000
commit4eeecc48cbd801ea8038fc1c5325a00d7120d1d7 (patch)
tree9a6a1c43524ffcf59fb55f59f705614bcc2b0a22 /src/gui/itemcontainer.cpp
parent0601642d8b3aa2c7aa365e27aa3ef2459553c3fd (diff)
downloadmana-client-4eeecc48cbd801ea8038fc1c5325a00d7120d1d7.tar.gz
mana-client-4eeecc48cbd801ea8038fc1c5325a00d7120d1d7.tar.bz2
mana-client-4eeecc48cbd801ea8038fc1c5325a00d7120d1d7.tar.xz
mana-client-4eeecc48cbd801ea8038fc1c5325a00d7120d1d7.zip
inventory - split function fix
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r--src/gui/itemcontainer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index 2f65d157..4ac2fba9 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -32,6 +32,8 @@
#include "../item.h"
#include "../localplayer.h"
+#include "../log.h"
+
#include "../resources/image.h"
#include "../resources/iteminfo.h"
#include "../resources/resourcemanager.h"
@@ -244,6 +246,7 @@ ItemContainer::mouseReleased(gcn::MouseEvent &event)
mDragged = false;
const int index = getSlotIndex(event.getX(), event.getY());
+ logger->log("index=%d", index);
if (index == Inventory::NO_SLOT_INDEX) {
return;
}
@@ -258,8 +261,7 @@ ItemContainer::mouseReleased(gcn::MouseEvent &event)
int
ItemContainer::getSlotIndex(const int posX, const int posY) const
{
- if(gcn::Rectangle(0, 0, (getWidth() - 1), (getHeight() - 1))
- .isPointInRect(posX, posY))
+ if (getDimension().isPointInRect(posX, posY))
{
// Takes into account, boxes are overlapping each other.
return (posY / (BOX_HEIGHT - 1)) * mGridColumns +