- Timestamp:
- 10/29/08 16:27:49 (4 years ago)
- Files:
-
- 1 modified
-
trunk/src/chart.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/chart.py
r111 r127 72 72 self.options.merge(options) 73 73 74 def getSurfaceSize(self): 75 cx = cairo.Context(self.surface) 76 x, y, w, h = cx.clip_extents() 77 return w, h 78 74 79 def reset(self): 75 80 """Resets options and datasets. … … 178 183 179 184 # calculate area data 180 width = (self.surface.get_width() 185 surface_width, surface_height = self.getSurfaceSize() 186 width = (surface_width 181 187 - self.options.padding.left - self.options.padding.right) 182 height = (s elf.surface.get_height()188 height = (surface_height 183 189 - self.options.padding.top - self.options.padding.bottom) 184 190 … … 507 513 return 508 514 509 surfaceWidth = self.surface.get_width() 510 surfaceHeight = self.surface.get_height() 515 surface_width, surface_height = self.getSurfaceSize() 511 516 512 517 # Compute legend dimensions … … 525 530 legend = self.options.legend 526 531 if legend.position.right is not None: 527 legend.position.left = (surface Width532 legend.position.left = (surface_width 528 533 - legend.position.right 529 534 - width) 530 535 if legend.position.bottom is not None: 531 legend.position.top = (surface Height536 legend.position.top = (surface_height 532 537 - legend.position.bottom 533 538 - height)
