[rhmessaging-commits] rhmessaging commits: r4189 - mgmt/newdata/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri Aug 6 10:10:11 EDT 2010


Author: eallen
Date: 2010-08-06 10:10:10 -0400 (Fri, 06 Aug 2010)
New Revision: 4189

Modified:
   mgmt/newdata/cumin/python/cumin/charts.py
Log:
Fix for BZ 620923. Convert width, height parameters passed to ALL ImageSurface calls into ints.

Modified: mgmt/newdata/cumin/python/cumin/charts.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/charts.py	2010-08-06 13:46:22 UTC (rev 4188)
+++ mgmt/newdata/cumin/python/cumin/charts.py	2010-08-06 14:10:10 UTC (rev 4189)
@@ -26,7 +26,7 @@
         self.surface = None
 
     def plot_dot(self, interior, width, height):
-        surface = ImageSurface(FORMAT_ARGB32, width, height)
+        surface = ImageSurface(FORMAT_ARGB32, int(width), int(height))
         cr = Context(surface)
         cr.set_line_width(1)
 
@@ -43,7 +43,7 @@
         col = 0
         self.rows = 1
         # the width and height depend on the number of slots
-        self.surface = ImageSurface(FORMAT_ARGB32, self.width, self.height)
+        self.surface = ImageSurface(FORMAT_ARGB32, int(self.width), int(self.height))
         cr = Context(self.surface)
         cr.set_line_width(1)
         i = 0
@@ -95,10 +95,10 @@
         #    if size < self.max_size:
         #        size = size + 1
 
-        self.width = (size * cols) + 1
+        self.width = int((size * cols) + 1)
         #if self.width < self.max_width:
         #    self.width = self.max_width
-        self.height = (ceil(count * 1.0 / cols) * size) + 1
+        self.height = int((ceil(count * 1.0 / cols) * size) + 1)
         #if self.height < self.max_height:
         #    self.height = self.max_height
         self.cols = cols
@@ -112,7 +112,7 @@
         self.width = width - 40
         self.height = height - 20
         real_height = height + ((interval > 10) and 12 or 0)
-        self.surface = ImageSurface(FORMAT_ARGB32, width, real_height)
+        self.surface = ImageSurface(FORMAT_ARGB32, int(width), int(real_height))
         self.surface.set_device_offset(1.5, 5.5)
         self.x_max = 1
         self.x_min = 0
@@ -296,7 +296,7 @@
         super(StackedValueChart, self).__init__(width, height)
 
         if legend_height:
-            self.surface = ImageSurface(FORMAT_ARGB32, width, height + legend_height)
+            self.surface = ImageSurface(FORMAT_ARGB32, int(width), int(height + legend_height))
             self.surface.set_device_offset(1.5, 5.5)
 
         self.legend_height = legend_height



More information about the rhmessaging-commits mailing list