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

Function draw_quad

src_classic/utils.py:2036–2068  ·  view source on GitHub ↗

Draw a quadrilateral.

(
    page: Page,
    quad: quad_like,
    color: OptSeq = (0,),
    fill: OptSeq = None,
    dashes: OptStr = None,
    width: float = 1,
    lineCap: int = 0,
    lineJoin: int = 0,
    morph: OptSeq = None,
    overlay: bool = True,
    stroke_opacity: float = 1,
    fill_opacity: float = 1,
    oc: int = 0,
)

Source from the content-addressed store, hash-verified

2034
2035
2036def draw_quad(
2037 page: Page,
2038 quad: quad_like,
2039 color: OptSeq = (0,),
2040 fill: OptSeq = None,
2041 dashes: OptStr = None,
2042 width: float = 1,
2043 lineCap: int = 0,
2044 lineJoin: int = 0,
2045 morph: OptSeq = None,
2046 overlay: bool = True,
2047 stroke_opacity: float = 1,
2048 fill_opacity: float = 1,
2049 oc: int = 0,
2050) -> Point:
2051 """Draw a quadrilateral."""
2052 img = page.new_shape()
2053 Q = img.draw_quad(Quad(quad))
2054 img.finish(
2055 color=color,
2056 fill=fill,
2057 dashes=dashes,
2058 width=width,
2059 lineCap=lineCap,
2060 lineJoin=lineJoin,
2061 morph=morph,
2062 stroke_opacity=stroke_opacity,
2063 fill_opacity=fill_opacity,
2064 oc=oc,
2065 )
2066 img.commit(overlay)
2067
2068 return Q
2069
2070
2071def draw_polyline(

Callers

nothing calls this directly

Calls 5

QuadClass · 0.85
new_shapeMethod · 0.80
draw_quadMethod · 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…