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

Method draw_polyline

src_classic/utils.py:3151–3163  ·  view source on GitHub ↗

Draw several connected line segments.

(self, points: list)

Source from the content-addressed store, hash-verified

3149 return self.lastPoint
3150
3151 def draw_polyline(self, points: list) -> Point:
3152 """Draw several connected line segments."""
3153 for i, p in enumerate(points):
3154 if i == 0:
3155 if not (self.lastPoint == Point(p)):
3156 self.draw_cont += "%g %g m\n" % JM_TUPLE(Point(p) * self.ipctm)
3157 self.lastPoint = Point(p)
3158 else:
3159 self.draw_cont += "%g %g l\n" % JM_TUPLE(Point(p) * self.ipctm)
3160 self.updateRect(p)
3161
3162 self.lastPoint = Point(points[-1])
3163 return self.lastPoint
3164
3165 def draw_bezier(
3166 self,

Callers 3

draw_quadMethod · 0.95
draw_zigzagMethod · 0.95
draw_polylineFunction · 0.45

Calls 3

updateRectMethod · 0.95
PointClass · 0.85
JM_TUPLEFunction · 0.85

Tested by

no test coverage detected