Draw a line between two points.
(self, p1: point_like, p2: point_like)
| 3135 | self.rect.y1 = max(self.rect.y1, x.y1) |
| 3136 | |
| 3137 | def draw_line(self, p1: point_like, p2: point_like) -> Point: |
| 3138 | """Draw a line between two points.""" |
| 3139 | p1 = Point(p1) |
| 3140 | p2 = Point(p2) |
| 3141 | if not (self.lastPoint == p1): |
| 3142 | self.draw_cont += "%g %g m\n" % JM_TUPLE(p1 * self.ipctm) |
| 3143 | self.lastPoint = p1 |
| 3144 | self.updateRect(p1) |
| 3145 | |
| 3146 | self.draw_cont += "%g %g l\n" % JM_TUPLE(p2 * self.ipctm) |
| 3147 | self.updateRect(p2) |
| 3148 | self.lastPoint = p2 |
| 3149 | return self.lastPoint |
| 3150 | |
| 3151 | def draw_polyline(self, points: list) -> Point: |
| 3152 | """Draw several connected line segments.""" |
no test coverage detected