diff options
author | Thomas Jourdan <b.vehikel@googlemail.com> | 2009-12-06 12:40:41 (GMT) |
---|---|---|
committer | Thomas Jourdan <b.vehikel@googlemail.com> | 2009-12-06 12:40:41 (GMT) |
commit | 7ce7155dead3893e572006588fc342fb3af7ec60 (patch) | |
tree | 2bb234d6d159aa797767bf1ceccea53117dc773a /ka_incoming.py | |
parent | bcde11455168a07de8a3b17f2a4d77ce8931e75d (diff) |
Layers are now arranged as a tree data structure.
Diffstat (limited to 'ka_incoming.py')
-rw-r--r-- | ka_incoming.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ka_incoming.py b/ka_incoming.py index 10aacff..6e22b74 100644 --- a/ka_incoming.py +++ b/ka_incoming.py @@ -33,7 +33,7 @@ class KandidIncoming(object): """ ka_debug.info('Append protozoon') while len(self.incoming_protozoans) >= self.capacity: - self.incoming_protozoans[0:1] = [] + del self.incoming_protozoans[0] self.incoming_protozoans.append(incoming_protozoon) def accept_protozoon(self, model, index): @@ -44,7 +44,7 @@ class KandidIncoming(object): if index < len(self.incoming_protozoans): ka_debug.info('accept incoming protozoon %u' % index) new_at = model.replace(self.incoming_protozoans[index]) - self.incoming_protozoans[index:1] = [] + del self.incoming_protozoans[index] return new_at def decline_protozoon(self, index): @@ -53,10 +53,10 @@ class KandidIncoming(object): """ if index < len(self.incoming_protozoans): ka_debug.info('decline incoming protozoon %u' % index) - self.incoming_protozoans[index:1] = [] + del self.incoming_protozoans[index] def draw(self, index, ctx, width, height): - """ Repaint all protozoon images inside incoming area. + """ Repaint one protozoon image inside incoming area. pre: 0 <= index < self.capacity pre: ctx is not None pre: width > 0 @@ -65,4 +65,9 @@ class KandidIncoming(object): if index < len(self.incoming_protozoans): # draw protozoon self.incoming_protozoans[index].render(ctx, width, height) + else: + ctx.set_source_rgba(0.65, 0.65, 0.65, 0.0) + ctx.rectangle(0.0, 0.0, width, height) + ctx.fill() + |