Implement the frame mouse activation logic.

Some fixes in the Timeline
This commit is contained in:
Marco Pesenti Gritti
2006-09-21 14:45:36 +02:00
parent 446a58d52c
commit a054eb3a4b
2 changed files with 40 additions and 14 deletions
+12 -1
View File
@@ -40,6 +40,17 @@ class Timeline:
n_frames = tag.start_frame - tag.end_frame
self._observer.next_frame(tag.name, frame, n_frames)
def goto(self, tag_name, end_frame=False):
self.stop()
tag = self._name_to_tag[tag_name]
if end_frame:
self._current_frame = tag.end_frame
else:
self._current_frame = tag.start_frame
self._next_frame(tag, self._current_frame)
def on_tag(self, name):
tag = self._name_to_tag[name]
return (tag.start_frame <= self._current_frame and \
@@ -67,7 +78,7 @@ class Timeline:
self.stop()
if start_tag == None:
start = self._tags[0].start_frame
start = 0
else:
start = self._name_to_tag[start_tag].start_frame