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

Method draw_polyline

src/__init__.py:14910–14922  ·  view source on GitHub ↗

Draw several connected line segments.

(self, points: list)

Source from the content-addressed store, hash-verified

14908 return self.last_point
14909
14910 def draw_polyline(self, points: list) -> Point:
14911 """Draw several connected line segments."""
14912 for i, p in enumerate(points):
14913 if i == 0:
14914 if not (self.last_point == Point(p)):
14915 self.draw_cont += _format_g(JM_TUPLE(Point(p) * self.ipctm)) + " m\n"
14916 self.last_point = Point(p)
14917 else:
14918 self.draw_cont += _format_g(JM_TUPLE(Point(p) * self.ipctm)) + " l\n"
14919 self.updateRect(p)
14920
14921 self.last_point = Point(points[-1])
14922 return self.last_point
14923
14924 def draw_bezier(
14925 self,

Callers 2

draw_quadMethod · 0.95
draw_zigzagMethod · 0.95

Calls 4

updateRectMethod · 0.95
PointClass · 0.85
_format_gFunction · 0.85
JM_TUPLEFunction · 0.85

Tested by

no test coverage detected