Mercurial > MadButterfly
comparison pyink/frameline.py @ 1154:1c9ef65c74b2
Stop showing for second key frame of a tween
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 27 Dec 2010 17:05:25 +0800 |
parents | 5abf419d66e5 |
children | 1d1f2a1e43f6 |
comparison
equal
deleted
inserted
replaced
1153:5abf419d66e5 | 1154:1c9ef65c74b2 |
---|---|
301 # Only keyframes that is not right-side of NONE type tween should be | 301 # Only keyframes that is not right-side of NONE type tween should be |
302 # draw. | 302 # draw. |
303 pos = self._find_keyframe(frame_idx) | 303 pos = self._find_keyframe(frame_idx) |
304 key = self._keys[pos] | 304 key = self._keys[pos] |
305 if key.left_tween and not key.right_tween: | 305 if key.left_tween and not key.right_tween: |
306 left_key = self._keys[pos - 1] | 306 return |
307 if left_key.right_tween_type == 0: | |
308 return | |
309 pass | |
310 | 307 |
311 self._draw_keyframe_(frame_idx) | 308 self._draw_keyframe_(frame_idx) |
312 pass | 309 pass |
313 | 310 |
314 def _draw_keyframes(self): | 311 def _draw_keyframes(self): |
631 key = keyframe(idx) | 628 key = keyframe(idx) |
632 key.ref = ref | 629 key.ref = ref |
633 self._keys[insert_pos:insert_pos] = [key] | 630 self._keys[insert_pos:insert_pos] = [key] |
634 if insert_pos > 0 and self._keys[insert_pos - 1].right_tween: | 631 if insert_pos > 0 and self._keys[insert_pos - 1].right_tween: |
635 key.left_tween = True | 632 key.left_tween = True |
636 pass | 633 key.right_tween = True |
637 if insert_pos < (len(self._keys) - 1) and \ | 634 key.right_tween_type = self._keys[insert_pos - 1].right_tween_type |
638 self._keys[insert_pos + 1].left_tween: | |
639 key.right_tween = True | |
640 pass | 635 pass |
641 | 636 |
642 if self._drawing: | 637 if self._drawing: |
643 self._draw_keyframe(idx) | 638 self._draw_keyframe(idx) |
644 pass | 639 pass |
657 right_key = self._keys[key_pos] | 652 right_key = self._keys[key_pos] |
658 right_key.left_tween = False | 653 right_key.left_tween = False |
659 redraw_range = (right_key.idx, idx + 1) | 654 redraw_range = (right_key.idx, idx + 1) |
660 else: | 655 else: |
661 left_key = self._keys[key_pos - 1] | 656 left_key = self._keys[key_pos - 1] |
662 left_key.right_key = False | 657 left_key.right_tween = False |
663 redraw_range = (idx, left_key.idx + 1) | 658 redraw_range = (idx, left_key.idx + 1) |
664 pass | 659 pass |
665 for i in range(*redraw_range): | 660 for i in range(*redraw_range): |
666 self._draw_frame(i) | 661 self._draw_frame(i) |
667 pass | 662 pass |