/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to branchview/graphcell.py

  • Committer: Daniel Schierbeck
  • Date: 2008-04-02 23:21:11 UTC
  • mto: This revision was merged to the branch mainline in revision 481.
  • Revision ID: daniel.schierbeck@gmail.com-20080402232111-a2psy91ng4m9pvnb
Fixed bug where the broken lines markers were not drawn correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
        box_size = self.box_size(widget)
150
150
 
151
151
        ctx.set_line_width(box_size / 8)
152
 
        ctx.set_line_cap(cairo.LINE_CAP_BUTT)
153
152
 
154
153
        # Draw lines into the cell
155
154
        for start, end, colour in self.in_lines:
185
184
    
186
185
    def render_line(self, ctx, cell_area, box_size, mid, height, start, end, colour, flags):
187
186
        if start is None:
 
187
            ctx.set_line_cap(cairo.LINE_CAP_ROUND)
188
188
            x = cell_area.x + box_size * end + box_size / 2
189
189
            ctx.move_to(x, mid + height / 3)
190
190
            ctx.line_to(x, mid + height / 3)
192
192
            ctx.line_to(x, mid + height / 6)
193
193
            
194
194
        elif end is None:
 
195
            ctx.set_line_cap(cairo.LINE_CAP_ROUND)
195
196
            x = cell_area.x + box_size * start + box_size / 2
196
197
            ctx.move_to(x, mid - height / 3)
197
198
            ctx.line_to(x, mid - height / 3)
199
200
            ctx.line_to(x, mid - height / 6)
200
201
 
201
202
        else:
 
203
            ctx.set_line_cap(cairo.LINE_CAP_BUTT)
202
204
            startx = cell_area.x + box_size * start + box_size / 2
203
205
            endx = cell_area.x + box_size * end + box_size / 2
204
206
            
210
212
                ctx.curve_to(startx, mid - height / 5,
211
213
                             startx, mid - height / 5,
212
214
                             startx + (endx - startx) / 2, mid)
213
 
                 
 
215
 
214
216
                ctx.curve_to(endx, mid + height / 5,
215
217
                             endx, mid + height / 5 ,
216
 
                             endx, mid + height / 2)
 
218
                             endx, mid + height / 2 + 1)
217
219
 
218
220
        if flags & gtk.CELL_RENDERER_SELECTED:
219
221
            ctx.set_source_rgb(1.0, 1.0, 1.0)