/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 graphcell.py

  • Committer: Scott James Remnant
  • Date: 2005-10-17 01:07:49 UTC
  • Revision ID: scott@netsplit.com-20051017010749-15fa95fc2cf09289
Commit the first version of bzrk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
1
2
# -*- coding: UTF-8 -*-
2
3
"""Cell renderer for directed graph.
3
4
 
71
72
            metrics = pango_ctx.get_metrics(font_desc)
72
73
 
73
74
            ascent = pango.PIXELS(metrics.get_ascent())
74
 
            descent = pango.PIXELS(metrics.get_descent())
 
75
            descent = pango.PIXELS(metrics.get_ascent())
75
76
 
76
 
            self._box_size = ascent + descent + 6
 
77
            self._box_size = ascent + descent
77
78
            return self._box_size
78
79
 
79
80
    def set_colour(self, ctx, colour, bg, fg):
107
108
        to be, we let the TreeViewColumn take care of making them all
108
109
        line up.
109
110
        """
110
 
        box_size = self.box_size(widget) + 1
 
111
        box_size = self.box_size(widget)
111
112
 
112
113
        cols = self.node[0]
113
114
        for start, end, colour in self.in_lines + self.out_lines:
137
138
        ctx.rectangle(bg_area.x, bg_area.y, bg_area.width, bg_area.height)
138
139
        ctx.clip()
139
140
 
140
 
        box_size = self.box_size(widget)
141
 
 
142
 
        ctx.set_line_width(box_size / 8)
 
141
        ctx.set_line_width(2)
143
142
        ctx.set_line_cap(cairo.LINE_CAP_SQUARE)
144
143
 
 
144
        box_size = self.box_size(widget)
 
145
 
145
146
        # Draw lines into the cell
146
147
        for start, end, colour in self.in_lines:
147
148
            ctx.move_to(cell_area.x + box_size * start + box_size / 2,
187
188
        (column, colour) = self.node
188
189
        ctx.arc(cell_area.x + box_size * column + box_size / 2,
189
190
                cell_area.y + cell_area.height / 2,
190
 
                box_size / 4, 0, 2 * math.pi)
 
191
                box_size / 5, 0, 2 * math.pi)
191
192
 
192
193
        self.set_colour(ctx, colour, 0.0, 0.5)
193
194
        ctx.stroke_preserve()