- Timestamp:
- 03/20/08 13:03:40 (4 years ago)
- Files:
-
- 1 modified
-
trunk/src/line.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/line.py
r75 r77 43 43 def preparePath(storeName): 44 44 cx.new_path() 45 cx.move_to(self.area.x, self.area.y + self.area.h) 45 firstPoint = True 46 lastX = None 47 if self.options.shouldFill: 48 # Go to the (0,0) coordinate to start drawing the area 49 cx.move_to(self.area.x, self.area.y + self.area.h) 50 46 51 for point in self.points: 47 52 if point.name == storeName: 53 if not self.options.shouldFill and firstPoint: 54 # starts the first point of the line 55 cx.move_to(point.x * self.area.w + self.area.x, 56 point.y * self.area.h + self.area.y) 57 firstPoint = False 58 continue 48 59 cx.line_to(point.x * self.area.w + self.area.x, 49 60 point.y * self.area.h + self.area.y) 50 cx.line_to(self.area.w + self.area.x, self.area.h + self.area.y) 51 cx.line_to(self.area.x, self.area.y + self.area.h) 61 # we remember the last X coordinate to close the area 62 # properly. See bug #4 63 lastX = point.x 52 64 53 65 if self.options.shouldFill: 66 # Close the path to the start point 67 cx.line_to(lastX * self.area.w + self.area.x, 68 self.area.h + self.area.y) 69 cx.line_to(self.area.x, self.area.y + self.area.h) 54 70 cx.close_path() 55 71 else:
