Changeset 94
- Timestamp:
- 09/12/08 01:21:56 (4 years ago)
- Files:
-
- 1 modified
-
trunk/src/bar.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bar.py
r85 r94 49 49 self.barMargin = (xdelta * self.xscale 50 50 * (1.0 - self.options.barWidthFillFraction) / 2) 51 51 52 52 self.minxdelta = xdelta 53 53 self.bars = [] … … 58 58 def drawBar(bar): 59 59 cx.set_line_width(self.options.stroke.width) 60 60 61 61 # gather bar proportions 62 62 x = self.area.w * bar.x + self.area.x … … 64 64 w = self.area.w * bar.w 65 65 h = self.area.h * bar.h 66 66 67 67 if w < 1 or h < 1: 68 68 return # don't draw when the bar is too small 69 69 70 70 if self.options.stroke.shadow: 71 71 cx.set_source_rgba(0, 0, 0, 0.15) … … 73 73 cx.rectangle(*rectangle) 74 74 cx.fill() 75 75 76 76 if self.options.shouldFill: 77 77 cx.rectangle(x, y, w, h) 78 78 cx.set_source_rgb(*self.options.colorScheme[bar.name]) 79 79 cx.fill_preserve() 80 80 81 81 if not self.options.stroke.hide: 82 82 cx.set_source_rgb(*hex2rgb(self.options.stroke.color)) 83 83 cx.stroke() 84 84 85 85 cx.save() 86 86 for bar in self.bars: … … 103 103 y = 1.0 - h 104 104 rect = Rect(x, y, w, h, xval, yval, name) 105 105 106 106 if (0.0 <= rect.x <= 1.0) and (0.0 <= rect.y <= 1.0): 107 107 self.bars.append(rect) … … 132 132 w = (yval - self.minyval) * self.yscale 133 133 rect = Rect(x, y, w, h, xval, yval, name) 134 134 135 135 if (0.0 <= rect.x <= 1.0) and (0.0 <= rect.y <= 1.0): 136 136 self.bars.append(rect)
