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

Method curveto

src/__init__.py:23072–23097  ·  view source on GitHub ↗
(self, ctx, x1, y1, x2, y2, x3, y3)

Source from the content-addressed store, hash-verified

23070 raise
23071
23072 def curveto(self, ctx, x1, y1, x2, y2, x3, y3): # trace_curveto().
23073 #log(f'Walker(): {self.dev.pathdict=}')
23074 try:
23075 self.dev.linecount = 0 # reset # of consec. lines
23076 p1 = mupdf.fz_make_point(x1, y1)
23077 p2 = mupdf.fz_make_point(x2, y2)
23078 p3 = mupdf.fz_make_point(x3, y3)
23079 p1 = mupdf.fz_transform_point(p1, self.dev.ctm)
23080 p2 = mupdf.fz_transform_point(p2, self.dev.ctm)
23081 p3 = mupdf.fz_transform_point(p3, self.dev.ctm)
23082 self.dev.pathrect = mupdf.fz_include_point_in_rect(self.dev.pathrect, p1)
23083 self.dev.pathrect = mupdf.fz_include_point_in_rect(self.dev.pathrect, p2)
23084 self.dev.pathrect = mupdf.fz_include_point_in_rect(self.dev.pathrect, p3)
23085
23086 list_ = (
23087 "c",
23088 JM_py_from_point(self.dev.lastpoint),
23089 JM_py_from_point(p1),
23090 JM_py_from_point(p2),
23091 JM_py_from_point(p3),
23092 )
23093 self.dev.lastpoint = p3
23094 self.dev.pathdict[ dictkey_items].append( list_)
23095 except Exception:
23096 if g_exceptions_verbose: exception_info()
23097 raise
23098
23099 def lineto(self, ctx, x, y): # trace_lineto().
23100 #log(f'Walker(): {self.dev.pathdict=}')

Callers

nothing calls this directly

Calls 3

JM_py_from_pointFunction · 0.85
exception_infoFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected