diff options
author | pmoxhay <pmoxhay@earthlink.net> | 2009-02-03 21:09:53 (GMT) |
---|---|---|
committer | pmoxhay <pmoxhay@earthlink.net> | 2009-02-03 21:09:53 (GMT) |
commit | 1e872e8c4e41d429638f73e6ad8b20bcc6ddf7e8 (patch) | |
tree | 1eb9f532cef7f7d8d5c1a7fc0035222ec8448009 /movableobject.py | |
parent | 1ca75a6332a4c57b26e85a962cc1de9cbddad5e2 (diff) |
Line segments and signs constrained to stay in the screen.
Drop targets highlight correctly when moving by key press.
Diffstat (limited to 'movableobject.py')
-rw-r--r-- | movableobject.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/movableobject.py b/movableobject.py index 9efe123..1749c4d 100644 --- a/movableobject.py +++ b/movableobject.py @@ -141,17 +141,22 @@ class MovableObject(Object): self.container.drag_object = None self.container.snap_to_grid(self) - b = False + has_drop_target = False + inside_drop_target = False #Check whether the drop is inside a drop target. for o in self.drop_targets: + has_drop_target = True if o.contains(self.get_bounds()): - b = True + inside_drop_target = True if o.processDrop(self): return True self.drag_type = None + + if has_drop_target and not inside_drop_target : + self.container.remove_object(self) # Remember the drag position self.press_pos = epos |