Relax the checking of navigability slightly, to handle the case where handle_size=0. Closes LP #562039

This commit is contained in:
Chris Jones 2010-04-13 12:55:10 +01:00
parent f05986fe72
commit 5ac45778d5
1 changed files with 4 additions and 4 deletions

View File

@ -203,13 +203,13 @@ def get_nav_possible(edge, allocation, direction):
"""Check if the supplied allocation is in the right direction of the """Check if the supplied allocation is in the right direction of the
supplied edge""" supplied edge"""
if direction == 'left': if direction == 'left':
return((allocation.x + allocation.width) < edge) return((allocation.x + allocation.width) <= edge)
elif direction == 'right': elif direction == 'right':
return(allocation.x > edge) return(allocation.x >= edge)
elif direction == 'up': elif direction == 'up':
return((allocation.y + allocation.height) < edge) return((allocation.y + allocation.height) <= edge)
elif direction == 'down': elif direction == 'down':
return(allocation.y > edge) return(allocation.y >= edge)
else: else:
raise ValueError('Unknown direction: %s' % direction) raise ValueError('Unknown direction: %s' % direction)