(ctx, path, transform, clip=None)
| 43 | |
| 44 | |
| 45 | def _append_path(ctx, path, transform, clip=None): |
| 46 | for points, code in path.iter_segments( |
| 47 | transform, remove_nans=True, clip=clip): |
| 48 | if code == Path.MOVETO: |
| 49 | ctx.move_to(*points) |
| 50 | elif code == Path.CLOSEPOLY: |
| 51 | ctx.close_path() |
| 52 | elif code == Path.LINETO: |
| 53 | ctx.line_to(*points) |
| 54 | elif code == Path.CURVE3: |
| 55 | cur = np.asarray(ctx.get_current_point()) |
| 56 | a = points[:2] |
| 57 | b = points[-2:] |
| 58 | ctx.curve_to(*(cur / 3 + a * 2 / 3), *(a * 2 / 3 + b / 3), *b) |
| 59 | elif code == Path.CURVE4: |
| 60 | ctx.curve_to(*points) |
| 61 | |
| 62 | |
| 63 | def _cairo_font_args_from_font_prop(prop): |
no test coverage detected
searching dependent graphs…