# HG changeset patch # User Thinker K.F. Li # Date 1289883113 -28800 # Node ID 8db3dd03508fbd563326160e69d0621cdaf10e45 # Parent b0edd13779ee43b3b8ef153f3a7e9fe630186aad Draw line to connect continious tween frames diff -r b0edd13779ee -r 8db3dd03508f pyink/frameline.py --- a/pyink/frameline.py Tue Nov 16 12:12:21 2010 +0800 +++ b/pyink/frameline.py Tue Nov 16 12:51:53 2010 +0800 @@ -26,7 +26,7 @@ _select_color = 0xee2222 # color of border of selected frame _key_mark_color = 0x000000 # color of marks for key frames. _key_mark_sz = 4 # width and height of a key frame mark - _tween_color = 0x000000 # color of tween line + _tween_color = 0x808080 # color of tween line _tween_bgcolors = [0x80ff80, 0xff8080] # bg colors of tween frames # Colors for normal frames _normal_bgcolors = [0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xcccccc] @@ -74,6 +74,22 @@ draw_w = (last_key.idx - first_key.idx + 1) * self._frame_width - 1 win.draw_rectangle(gc, True, draw_x, 0, draw_w, w_h) + + # + # Set color of tween line + # + line_v = self._tween_color + line_rgb = color_to_rgb(line_v) + line_color = gtk.gdk.Color(*line_rgb) + gc.set_rgb_fg_color(line_color) + + # + # Draw tween line + # + line_x1 = (first_key.idx + 0.5) * self._frame_width + line_x2 = line_x1 + (last_key.idx - first_key.idx) * self._frame_width + line_y = w_h * 2 / 3 + win.draw_line(gc, line_x1, line_y, line_x2, line_y) pass def _draw_frame(self, idx):