summaryrefslogtreecommitdiff
path: root/src/gui/itemshortcutcontainer.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-20 12:35:38 -0700
committerIra Rice <irarice@gmail.com>2009-01-20 12:35:38 -0700
commit7db9e03f34bf150dbcfec981cc3b4105bda92ada (patch)
tree906e18e622f6965822ceaaa191bdebc9d236cef3 /src/gui/itemshortcutcontainer.cpp
parentf404997629d9a34f5a15261073536903a59a604c (diff)
downloadmana-7db9e03f34bf150dbcfec981cc3b4105bda92ada.tar.gz
mana-7db9e03f34bf150dbcfec981cc3b4105bda92ada.tar.bz2
mana-7db9e03f34bf150dbcfec981cc3b4105bda92ada.tar.xz
mana-7db9e03f34bf150dbcfec981cc3b4105bda92ada.zip
Changed item popup drawing to be based on the mouse position, not window
position. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/itemshortcutcontainer.cpp')
-rw-r--r--src/gui/itemshortcutcontainer.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp
index 950c042a..40b435cc 100644
--- a/src/gui/itemshortcutcontainer.cpp
+++ b/src/gui/itemshortcutcontainer.cpp
@@ -18,6 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <SDL_mouse.h>
#include "itemshortcutcontainer.h"
@@ -223,23 +224,12 @@ void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event)
if (item)
{
- if (getParent()->getParent()->getWidth() <
- getParent()->getParent()->getHeight())
- {
- mItemPopup->setPosition(getParent()->getParent()->getX() -
- mItemPopup->getWidth(),
- getParent()->getParent()->getY());
- }
- else
- {
- mItemPopup->setPosition(getParent()->getParent()->getX(),
- getParent()->getParent()->getY() +
- getParent()->getParent()->getHeight());
- }
+ int mouseX, mouseY;
+ SDL_GetMouseState(&mouseX, &mouseY);
mItemPopup->setItem(item->getInfo());
mItemPopup->setOpaque(false);
- mItemPopup->setVisible(true);
+ mItemPopup->view(mouseX, mouseY);
}
else
{