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

Method closepath

src/__init__.py:23044–23070  ·  view source on GitHub ↗
(self, ctx)

Source from the content-addressed store, hash-verified

23042 self.dev = dev
23043
23044 def closepath(self, ctx): # trace_close().
23045 #log(f'Walker(): {self.dev.pathdict=}')
23046 try:
23047 if self.dev.linecount == 3:
23048 if jm_checkrect(self.dev):
23049 #log(f'end1: {self.dev.pathdict=}')
23050 return
23051 self.dev.linecount = 0 # reset # of consec. lines
23052
23053 if self.dev.havemove:
23054 if self.dev.lastpoint != self.dev.firstpoint:
23055 item = ("l", JM_py_from_point(self.dev.lastpoint),
23056 JM_py_from_point(self.dev.firstpoint))
23057 self.dev.pathdict[dictkey_items].append(item)
23058 self.dev.lastpoint = self.dev.firstpoint
23059 self.dev.pathdict["closePath"] = False
23060
23061 else:
23062 #log('setting self.dev.pathdict[ "closePath"] to true')
23063 self.dev.pathdict[ "closePath"] = True
23064 #log(f'end2: {self.dev.pathdict=}')
23065
23066 self.dev.havemove = 0
23067
23068 except Exception:
23069 if g_exceptions_verbose: exception_info()
23070 raise
23071
23072 def curveto(self, ctx, x1, y1, x2, y2, x3, y3): # trace_curveto().
23073 #log(f'Walker(): {self.dev.pathdict=}')

Callers

nothing calls this directly

Calls 4

jm_checkrectFunction · 0.85
JM_py_from_pointFunction · 0.85
exception_infoFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected