Fix some bugs with frame animation and enable it

This commit is contained in:
Marco Pesenti Gritti 2007-02-27 17:04:15 +01:00
parent e478de4224
commit 7081909d2d
2 changed files with 5 additions and 4 deletions

View File

@ -31,7 +31,7 @@ from model.ShellModel import ShellModel
from sugar.graphics.timeline import Timeline
from sugar.graphics import units
_ANIMATION = False
_ANIMATION = True
class Frame:
INACTIVE = 0
@ -132,7 +132,7 @@ class Frame:
x = (x2 - x1) * pos + x1
y = (y2 - y1) * pos + y1
panel.move(x, y)
panel.move(int(x), int(y))
# FIXME we should hide and show as necessary to free memory
if not panel.props.visible:
@ -172,7 +172,8 @@ class Frame:
def _enter_notify(self):
self._hover_frame = True
self._timeline.goto('slide_in', True)
if not self._timeline.on_tag('slide_in'):
self._timeline.goto('slide_in', True)
def _leave_notify(self, panel):
self._hover_frame = False

View File

@ -68,7 +68,7 @@ class Timeline:
else:
self._current_frame = tag.start_frame
self._next_frame(tag, self._current_frame)
self._next_frame(tag, self._current_frame - tag.start_frame)
def on_tag(self, name):
tag = self._name_to_tag[name]