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

Method draw_zigzag

src/__init__.py:11340–11373  ·  view source on GitHub ↗

Draw a zigzag 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

11338 return p
11339
11340 def draw_zigzag(
11341 page: 'Page',
11342 p1: point_like,
11343 p2: point_like,
11344 breadth: float = 2,
11345 color: OptSeq = (0,),
11346 dashes: OptStr = None,
11347 width: float = 1,
11348 lineCap: int = 0,
11349 lineJoin: int = 0,
11350 overlay: bool = True,
11351 morph: OptSeq = None,
11352 stroke_opacity: float = 1,
11353 fill_opacity: float = 1,
11354 oc: int = 0,
11355 ) -> Point:
11356 """Draw a zigzag line from point p1 to point p2."""
11357 img = page.new_shape()
11358 p = img.draw_zigzag(Point(p1), Point(p2), breadth=breadth)
11359 img.finish(
11360 color=color,
11361 dashes=dashes,
11362 width=width,
11363 closePath=False,
11364 lineCap=lineCap,
11365 lineJoin=lineJoin,
11366 morph=morph,
11367 stroke_opacity=stroke_opacity,
11368 fill_opacity=fill_opacity,
11369 oc=oc,
11370 )
11371 img.commit(overlay)
11372
11373 return p
11374
11375 def extend_textpage(self, tpage, flags=0, matrix=None):
11376 page = self.this

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected