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

Method lineto

src/__init__.py:23099–23118  ·  view source on GitHub ↗
(self, ctx, x, y)

Source from the content-addressed store, hash-verified

23097 raise
23098
23099 def lineto(self, ctx, x, y): # trace_lineto().
23100 #log(f'Walker(): {self.dev.pathdict=}')
23101 try:
23102 p1 = mupdf.fz_transform_point( mupdf.fz_make_point(x, y), self.dev.ctm)
23103 self.dev.pathrect = mupdf.fz_include_point_in_rect( self.dev.pathrect, p1)
23104 list_ = (
23105 'l',
23106 JM_py_from_point( self.dev.lastpoint),
23107 JM_py_from_point(p1),
23108 )
23109 self.dev.lastpoint = p1
23110 items = self.dev.pathdict[ dictkey_items]
23111 items.append( list_)
23112 self.dev.linecount += 1 # counts consecutive lines
23113 if self.dev.linecount == 4 and self.dev.path_type != trace_device_FILL_PATH:
23114 # shrink to "re" or "qu" item
23115 jm_checkquad(self.dev)
23116 except Exception:
23117 if g_exceptions_verbose: exception_info()
23118 raise
23119
23120 def moveto(self, ctx, x, y): # trace_moveto().
23121 if 0 and isinstance(self.dev.pathdict, dict):

Callers

nothing calls this directly

Calls 4

JM_py_from_pointFunction · 0.85
jm_checkquadFunction · 0.85
exception_infoFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected