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

Function draw_squiggle

src_classic/utils.py:1928–1961  ·  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

1926
1927
1928def draw_squiggle(
1929 page: Page,
1930 p1: point_like,
1931 p2: point_like,
1932 breadth: float = 2,
1933 color: OptSeq = (0,),
1934 dashes: OptStr = None,
1935 width: float = 1,
1936 lineCap: int = 0,
1937 lineJoin: int = 0,
1938 overlay: bool = True,
1939 morph: OptSeq = None,
1940 stroke_opacity: float = 1,
1941 fill_opacity: float = 1,
1942 oc: int = 0,
1943) -> Point:
1944 """Draw a squiggly line from point p1 to point p2."""
1945 img = page.new_shape()
1946 p = img.draw_squiggle(Point(p1), Point(p2), breadth=breadth)
1947 img.finish(
1948 color=color,
1949 dashes=dashes,
1950 width=width,
1951 closePath=False,
1952 lineCap=lineCap,
1953 lineJoin=lineJoin,
1954 morph=morph,
1955 stroke_opacity=stroke_opacity,
1956 fill_opacity=fill_opacity,
1957 oc=oc,
1958 )
1959 img.commit(overlay)
1960
1961 return p
1962
1963
1964def draw_zigzag(

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…