MCPcopy Create free account
hub / github.com/PageBot/PageBot / closePath

Method closePath

Lib/pagebot/contexts/basecontext/basecontext.py:371–389  ·  view source on GitHub ↗

Closes the open path if it exists, otherwise ignore it. >>> from pagebot import getContext >>> context = getContext() >>> context.newPage(420, 420) >>> # Creates. a new self._bezierpath by property self.bezierpath. >>> context.moveTo(pt(100, 100)) >>>

(self)

Source from the content-addressed store, hash-verified

369 return self.b.arcTo(xy1, xy2, radius)
370
371 def closePath(self):
372 """Closes the open path if it exists, otherwise ignore it.
373
374 >>> from pagebot import getContext
375 >>> context = getContext()
376 >>> context.newPage(420, 420)
377 >>> # Creates. a new self._bezierpath by property self.bezierpath.
378 >>> context.moveTo(pt(100, 100))
379 >>> context.curveTo(pt(100, 200), pt(200, 200), pt(200, 100))
380 >>> context.closePath()
381 >>> # Drawing on a separate path.
382 >>> path = context.newPath()
383 >>> path.moveTo(pt(100, 100))
384 >>> path.curveTo(pt(100, 200), pt(200, 200), pt(200, 100))
385 >>> path.closePath()
386 >>> context.drawPath(path)
387 """
388 if self._bezierpath is not None: # Only if an open path exists.
389 self._bezierpath.closePath()
390
391 def drawPath(self, path=None, p=None, sx=1, sy=None, fill=None,
392 stroke=None, strokeWidth=None):

Callers 2

bluntCornerRectMethod · 0.95
roundedRectMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected