Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit 38a87be

Browse files
committed
Animation adjustments
1 parent 208228a commit 38a87be

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/animate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,21 @@ def __init__(self, canvas: tk.Canvas):
133133

134134
def start(self):
135135
while self._motions:
136-
print(self._motions)
137136
complete = self.run(self._motions.copy())
138137
self._motions -= complete
139138
time.sleep(1/self.fps)
140139

141140
def run(self, frame):
142141
done = set()
143142
for motion in frame:
143+
if not self.running:
144+
break
144145
try:
145146
next(motion)()
146147
self.canvas.update()
147148
except StopIteration:
148149
done.add(motion)
150+
self.canvas.update()
149151
return done
150152

151153
def add(self, motion: Motion):

src/view.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def __init__(self, data: T, viewtype: ViewType):
2323
viewtype = ViewType(viewtype.upper()) # Breaks if not string
2424
self.viewtype = viewtype
2525

26+
def __getattr__(self, name):
27+
return getattr(self.data, name)
28+
2629

2730
class Window(widget.PrimaryCanvas):
2831
animation_speed = 4
@@ -93,6 +96,7 @@ def change_view(self, view: View, direction: Direction = None):
9396
self.move_out(last, direction)
9497

9598
self.animater.start()
99+
print(len(self.views))
96100

97101
def get_distance(self, direction: Direction):
98102
if not isinstance(direction, Direction):

0 commit comments

Comments
 (0)