Fix logic

This commit is contained in:
Marco Pesenti Gritti 2006-09-01 18:38:23 +02:00
parent b15fb5ad50
commit e6b839f202

View File

@ -20,13 +20,18 @@ class IconLayout:
self._icons.remove(icon) self._icons.remove(icon)
def _is_valid_position(self, icon, x, y): def _is_valid_position(self, icon, x, y):
h_border = icon.props.size + 4 icon_size = icon.props.size
v_border = icon.props.size + 4 border = 20
if x < self._x1 - h_border or x > self._x2 + h_border:
return True if not (border < x < self._width - icon_size - border and \
if y < self._y1 - v_border or y > self._y2 + v_border: border < y < self._height - icon_size - border):
return True return False
return False
if self._x1 - icon_size - border < x < self._x2 + border and \
self._y1 - icon_size - border < y < self._y2 + border:
return False
return True
def _layout_icon(self, icon): def _layout_icon(self, icon):
while True: while True: