/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: Curtis Hovey
  • Date: 2011-08-27 20:13:10 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110827201310-idqm23ikh2a9wojv
inlined PANGO_PIXELS macro because it is not public.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        except AttributeError:
77
77
            pango_ctx = widget.get_pango_context()
78
78
            font_desc = widget.get_style().font_desc
79
 
            metrics = pango_ctx.get_metrics(font_desc)
80
 
 
81
 
            ascent = Pango.PIXELS(metrics.get_ascent())
82
 
            descent = Pango.PIXELS(metrics.get_descent())
 
79
            metrics = pango_ctx.get_metrics(font_desc, None)
 
80
 
 
81
            def PANGO_PIXELS(d):
 
82
                # Macro from  Pango header.
 
83
                return (d + 512) / 1000
 
84
 
 
85
            ascent = PANGO_PIXELS(metrics.get_ascent())
 
86
            descent = PANGO_PIXELS(metrics.get_descent())
83
87
 
84
88
            self._box_size = ascent + descent + 6
85
89
            return self._box_size