Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/hand.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-03-23 11:21:35 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-03-23 11:21:35 (GMT)
commita6a6d15fcfa73acbf7a1ea9027898c713184aa73 (patch)
treeb88bd7ab1fb315c0bdc98a52c30db2b10bb9c4c5 /hand.py
parenta962d723755dff326893abd077dd0e42113dbf02 (diff)
dragging works
Diffstat (limited to 'hand.py')
-rw-r--r--hand.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/hand.py b/hand.py
index 16cdea4..2086b84 100644
--- a/hand.py
+++ b/hand.py
@@ -99,7 +99,10 @@ class Hand:
def xy_to_hand(self, x, y):
''' Convert from sprite x,y to hand index. '''
- return int((y - self.top) / self.yinc)
+ if x < self.left + self.xinc:
+ return int((y - self.top) / self.yinc)
+ else:
+ return None
def hand_to_xy(self, i):
''' Convert from hand index to sprite x,y. '''