From 7714b7ba0520803994cd042e82c4cc20f7576e91 Mon Sep 17 00:00:00 2001 From: Agustin Zubiaga Date: Thu, 23 Feb 2012 19:23:25 +0000 Subject: Paint the chart in the center --- (limited to 'activity.py') diff --git a/activity.py b/activity.py index d422b89..303e98f 100644 --- a/activity.py +++ b/activity.py @@ -118,7 +118,15 @@ class ChartArea(gtk.DrawingArea): context.fill() # Paint the chart: - context.set_source_surface(self._parent.current_chart.surface) + cw = self._parent.current_chart.width + ch = self._parent.current_chart.height + + x, y, w, h = self.get_allocation() + + cx = x + w / 2 - cw / 2 + cy = y + h / 2 - ch / 2 + + context.set_source_surface(self._parent.current_chart.surface, cx, cy) context.paint() -- cgit v0.9.1