Specifies a straight line segment ending at the specified point.
| 297 | |
| 298 | |
| 299 | class _LineSegment(_BaseDrawingOperation): |
| 300 | """Specifies a straight line segment ending at the specified point.""" |
| 301 | |
| 302 | @classmethod |
| 303 | def new(cls, freeform_builder: FreeformBuilder, x: float, y: float) -> _LineSegment: |
| 304 | """Return a new _LineSegment object ending at point *(x, y)*. |
| 305 | |
| 306 | Both `x` and `y` are rounded to the nearest integer before use. |
| 307 | """ |
| 308 | return cls(freeform_builder, Emu(int(round(x))), Emu(int(round(y)))) |
| 309 | |
| 310 | def apply_operation_to(self, path: CT_Path2D) -> CT_Path2DLineTo: |
| 311 | """Add `a:lnTo` element to `path` for this line segment. |
| 312 | |
| 313 | Returns the `a:lnTo` element newly added to the path. |
| 314 | """ |
| 315 | return path.add_lnTo( |
| 316 | Emu(self._x - self._freeform_builder.shape_offset_x), |
| 317 | Emu(self._y - self._freeform_builder.shape_offset_y), |
| 318 | ) |
| 319 | |
| 320 | |
| 321 | class _MoveTo(_BaseDrawingOperation): |
no outgoing calls
searching dependent graphs…