MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / draw_squiggle

Method draw_squiggle

src/__init__.py:11305–11338  ·  view source on GitHub ↗

Draw a squiggly line from point p1 to point p2.

(
            page: 'Page',
            p1: point_like,
            p2: point_like,
            breadth: float = 2,
            color: OptSeq = (0,),
            dashes: OptStr = None,
            width: float = 1,
            lineCap: int = 0,
            lineJoin: int = 0,
            overlay: bool = True,
            morph: OptSeq = None,
            stroke_opacity: float = 1,
            fill_opacity: float = 1,
            oc: int = 0,
            )

Source from the content-addressed store, hash-verified

11303 return Q
11304
11305 def draw_squiggle(
11306 page: 'Page',
11307 p1: point_like,
11308 p2: point_like,
11309 breadth: float = 2,
11310 color: OptSeq = (0,),
11311 dashes: OptStr = None,
11312 width: float = 1,
11313 lineCap: int = 0,
11314 lineJoin: int = 0,
11315 overlay: bool = True,
11316 morph: OptSeq = None,
11317 stroke_opacity: float = 1,
11318 fill_opacity: float = 1,
11319 oc: int = 0,
11320 ) -> Point:
11321 """Draw a squiggly line from point p1 to point p2."""
11322 img = page.new_shape()
11323 p = img.draw_squiggle(Point(p1), Point(p2), breadth=breadth)
11324 img.finish(
11325 color=color,
11326 dashes=dashes,
11327 width=width,
11328 closePath=False,
11329 lineCap=lineCap,
11330 lineJoin=lineJoin,
11331 morph=morph,
11332 stroke_opacity=stroke_opacity,
11333 fill_opacity=fill_opacity,
11334 oc=oc,
11335 )
11336 img.commit(overlay)
11337
11338 return p
11339
11340 def draw_zigzag(
11341 page: 'Page',

Callers 1

test_drawings2Function · 0.45

Calls 4

PointClass · 0.85
new_shapeMethod · 0.80
finishMethod · 0.45
commitMethod · 0.45

Tested by 1

test_drawings2Function · 0.36