Changeset 175 for nodebox/trunk/src/nodebox/graphics/cocoa.py
- Timestamp:
- 10/01/07 15:37:11 (15 months ago)
- Files:
-
- 1 modified
-
nodebox/trunk/src/nodebox/graphics/cocoa.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nodebox/trunk/src/nodebox/graphics/cocoa.py
r159 r175 210 210 if path is None: 211 211 self._nsBezierPath = NSBezierPath.bezierPath() 212 elif isinstance(path, list):212 elif isinstance(path, (list,tuple)): 213 213 self._nsBezierPath = NSBezierPath.bezierPath() 214 214 self.extend(path) … … 293 293 self._segment_cache = None 294 294 for el in pathElements: 295 self.append(el) 295 if isinstance(el, (list, tuple)): 296 x, y = el 297 if len(self) == 0: 298 cmd = MOVETO 299 else: 300 cmd = LINETO 301 self.append(PathElement(cmd, ((x, y),))) 302 elif isinstance(el, PathElement): 303 self.append(el) 304 else: 305 raise NodeBoxError, "Don't know how to handle %s" % el 296 306 297 307 def append(self, el): … … 480 490 params = len(args) 481 491 482 if params == 1 and isinstance(args[0], Color): 492 if params == 1 and args[0] is None: 493 clr = NSColor.colorWithDeviceWhite_alpha_(0.0, 0.0) 494 elif params == 1 and isinstance(args[0], Color): 483 495 clr = args[0]._cmyk 484 496 elif params == 1 and isinstance(args[0], NSColor): … … 1558 1570 def drawpath(self, path, **kwargs): 1559 1571 BezierPath.checkKwargs(kwargs) 1560 if isinstance(path, list):1561 path = BezierPath(self, path,kwargs)1572 if isinstance(path, (list, tuple)): 1573 path = self.BezierPath(path, **kwargs) 1562 1574 path.inheritFromContext(kwargs.keys()) 1563 1575 path.draw()
