Some ArrowStyle classes only works with a simple quadratic Bézier curve (created with `.ConnectionStyle.Arc3` or `.ConnectionStyle.Angle3`). This static method checks if the provided path is a simple quadratic Bézier curve and returns its
(path)
| 3378 | |
| 3379 | @staticmethod |
| 3380 | def ensure_quadratic_bezier(path): |
| 3381 | """ |
| 3382 | Some ArrowStyle classes only works with a simple quadratic |
| 3383 | Bézier curve (created with `.ConnectionStyle.Arc3` or |
| 3384 | `.ConnectionStyle.Angle3`). This static method checks if the |
| 3385 | provided path is a simple quadratic Bézier curve and returns its |
| 3386 | control points if true. |
| 3387 | """ |
| 3388 | segments = list(path.iter_segments()) |
| 3389 | if (len(segments) != 2 or segments[0][1] != Path.MOVETO or |
| 3390 | segments[1][1] != Path.CURVE3): |
| 3391 | raise ValueError( |
| 3392 | "'path' is not a valid quadratic Bezier curve") |
| 3393 | return [*segments[0][0], *segments[1][0]] |
| 3394 | |
| 3395 | def transmute(self, path, mutation_size, linewidth): |
| 3396 | """ |
no test coverage detected