MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / draw_rect

Method draw_rect

src/__init__.py:11222–11257  ·  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

11220 return Q
11221
11222 def draw_rect(
11223 page: 'Page',
11224 rect: rect_like,
11225 color: OptSeq = (0,),
11226 fill: OptSeq = None,
11227 dashes: OptStr = None,
11228 width: float = 1,
11229 lineCap: int = 0,
11230 lineJoin: int = 0,
11231 morph: OptSeq = None,
11232 overlay: bool = True,
11233 stroke_opacity: float = 1,
11234 fill_opacity: float = 1,
11235 oc: int = 0,
11236 radius=None,
11237 ) -> Point:
11238 '''
11239 Draw a rectangle. See Shape class method for details.
11240 '''
11241 img = page.new_shape()
11242 Q = img.draw_rect(Rect(rect), radius=radius)
11243 img.finish(
11244 color=color,
11245 fill=fill,
11246 dashes=dashes,
11247 width=width,
11248 lineCap=lineCap,
11249 lineJoin=lineJoin,
11250 morph=morph,
11251 stroke_opacity=stroke_opacity,
11252 fill_opacity=fill_opacity,
11253 oc=oc,
11254 )
11255 img.commit(overlay)
11256
11257 return Q
11258
11259 def draw_sector(
11260 page: 'Page',

Callers 15

apply_redactionsMethod · 0.45
test_2812Function · 0.45
test_3148Function · 0.45
test_textbox5Function · 0.45
test_htmlbox1Function · 0.45
test_4613Function · 0.45
test_drawings2Function · 0.45
test_2365Function · 0.45
test_4079Function · 0.45
test_cluster2Function · 0.45
test_cluster3Function · 0.45
test_4182Function · 0.45

Calls 4

RectClass · 0.85
new_shapeMethod · 0.80
finishMethod · 0.45
commitMethod · 0.45

Tested by 15

test_2812Function · 0.36
test_3148Function · 0.36
test_textbox5Function · 0.36
test_htmlbox1Function · 0.36
test_4613Function · 0.36
test_drawings2Function · 0.36
test_2365Function · 0.36
test_4079Function · 0.36
test_cluster2Function · 0.36
test_cluster3Function · 0.36
test_4182Function · 0.36
test_4179Function · 0.36