Commit 00d595ce authored by Bruno Coudoin's avatar Bruno Coudoin

fixed anim activity

svn path=/branches/gcomprixogoo/; revision=3730
parent 0e93ba41
......@@ -214,7 +214,6 @@ class AnimItem:
"sounds/eraser2.wav")
self.delete_at_time(self.anim.timeline.get_time())
self.show(False)
print self.visible
def raise_(self):
parent = self.item.get_parent()
......@@ -261,6 +260,9 @@ class AnimItem:
self.set_visible_to_end(self.anim.timeline.get_time())
def create_item_drag_event(self, item, target, event):
if event.type == gtk.gdk.BUTTON_RELEASE:
self.save_at_time(self.anim.timeline.get_time())
if (event.type == gtk.gdk.MOTION_NOTIFY
and event.state & gtk.gdk.BUTTON1_MASK):
......@@ -585,7 +587,6 @@ class AnimItemRect(AnimItem):
bounds = self.item.get_bounds()
sx = (x2 - x1) / (bounds.x2 - bounds.x1)
sy = (y2 - y1) / (bounds.y2 - bounds.y1)
print "sx=%f sy=%f" %(sx, sy)
self.item.scale(sx, sy)
......
......@@ -130,7 +130,7 @@ class Timeline:
self.current_time = item.get_data("time")
# Let anim knows there is a new time set
#self.anim.refresh(self.get_time())
self.anim.refresh(self.get_time())
#
def timeline_item_event(self, item, target, event):
......
......@@ -64,6 +64,9 @@ class Gcompris_anim:
self.gcomprisBoard = gcomprisBoard
self.timeout = 0
# The list of all the user's objects
self.animlist = []
# There is two board in the same code
# here the diff in parameters
if self.gcomprisBoard.mode == 'draw':
......@@ -629,7 +632,7 @@ class Gcompris_anim:
target)
# We keep all object in a unique list
#self.animlist.append(self.created_object)
self.animlist.append(self.created_object)
#
# MOTION EVENT
......@@ -667,6 +670,11 @@ class Gcompris_anim:
return False
def refresh(self, time):
# We keep all object in a unique list
# Here we order them to refresh them for the given time
for item in self.animlist:
item.display_at_time(time)
def refresh_loop(self):
self.timeline.next()
......@@ -752,3 +760,5 @@ def image_selected(image):
fles.created_object.create_item_event(fles.root_drawingitem,
fles.root_drawingitem)
# We keep all object in a unique list
fles.animlist.append(fles.created_object)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment