Changeset 2326
- Timestamp:
- 07/03/08 13:07:28 (5 months ago)
- Files:
-
- gaphas/trunk/gaphas/painter.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphas/trunk/gaphas/painter.py
r2321 r2326 74 74 def __init__(self, **kwargs): 75 75 super(DrawContext, self).__init__(**kwargs) 76 77 def draw_children(self):78 """79 Extra helper method for drawing child items from within80 the Item.draw() method.81 """82 if not DrawContext.deprecated:83 print 'Usage of context.draw_children is deprecated.'84 DrawContext.deprecated = True85 86 #self.painter._draw_items(self._item.canvas.get_children(self._item),87 # self.view,88 # self.cairo,89 # self._area)90 76 91 77 … … 116 102 def _draw_items(self, items, view, cairo, area=None): 117 103 """ 118 Draw the items. This method can also be called from DrawContext 119 to draw sub-items. 104 Draw the items. 120 105 """ 121 106 for item in items: … … 158 143 def __init__(self, cairo): 159 144 self._cairo = cairo 160 self._nested = isinstance(cairo, CairoBoundingBoxContext)161 145 self._bounds = None # a Rectangle object 162 146 … … 203 187 if not b: 204 188 b = self._extents(cr.fill_extents) 205 if self._nested: 206 cr.fill(b) 207 else: 208 cr.fill() 189 cr.fill() 209 190 210 191 def fill_preserve(self, b=None): … … 215 196 if not b: 216 197 b = self._extents(cr.fill_extents) 217 if self._nested:218 cr.fill_preserve(b)219 198 220 199 def stroke(self, b=None): … … 225 204 if not b: 226 205 b = self._extents(cr.stroke_extents, line_width=True) 227 if self._nested: 228 cr.stroke(b) 229 else: 230 cr.stroke() 206 cr.stroke() 231 207 232 208 def stroke_preserve(self, b=None): … … 237 213 if not b: 238 214 b = self._extents(cr.stroke_extents, line_width=True) 239 if self._nested:240 cr.stroke_preserve(b)241 215 242 216 def show_text(self, utf8, b=None): … … 252 226 b = Rectangle(x0, y0, x1=x1, y1=y1) 253 227 self._update_bounds(b) 254 if self._nested: 255 cr.show_text(utf8, b) 256 else: 257 cr.show_text(utf8) 228 cr.show_text(utf8) 258 229 259 230 … … 283 254 def _draw_items(self, items, view, cairo, area=None): 284 255 """ 285 Draw the items. This method can also be called from DrawContext 286 to draw sub-items. 256 Draw the items. 287 257 """ 288 258 for item in items:
