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

Function draw_rect

src_classic/utils.py:2000–2033  ·  view source on GitHub ↗

Draw a rectangle. See Shape class method for details.

(
    page: Page,
    rect: rect_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,
    radius=None,
)

Source from the content-addressed store, hash-verified

1998
1999
2000def draw_rect(
2001 page: Page,
2002 rect: rect_like,
2003 color: OptSeq = (0,),
2004 fill: OptSeq = None,
2005 dashes: OptStr = None,
2006 width: float = 1,
2007 lineCap: int = 0,
2008 lineJoin: int = 0,
2009 morph: OptSeq = None,
2010 overlay: bool = True,
2011 stroke_opacity: float = 1,
2012 fill_opacity: float = 1,
2013 oc: int = 0,
2014 radius=None,
2015) -> Point:
2016 """Draw a rectangle. See Shape class method for details."""
2017 img = page.new_shape()
2018 Q = img.draw_rect(Rect(rect), radius=radius)
2019 img.finish(
2020 color=color,
2021 fill=fill,
2022 dashes=dashes,
2023 width=width,
2024 lineCap=lineCap,
2025 lineJoin=lineJoin,
2026 morph=morph,
2027 stroke_opacity=stroke_opacity,
2028 fill_opacity=fill_opacity,
2029 oc=oc,
2030 )
2031 img.commit(overlay)
2032
2033 return Q
2034
2035
2036def draw_quad(

Callers

nothing calls this directly

Calls 5

RectClass · 0.85
new_shapeMethod · 0.80
draw_rectMethod · 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…