| 748 | // it behaves as if the pen of a plotter was always down (drawing) |
| 749 | template <class VertexSource> |
| 750 | void join_path(VertexSource& vs, unsigned path_id = 0) |
| 751 | { |
| 752 | double x, y; |
| 753 | unsigned cmd; |
| 754 | vs.rewind(path_id); |
| 755 | cmd = vs.vertex(&x, &y); |
| 756 | if (!is_stop(cmd)) |
| 757 | { |
| 758 | if (is_vertex(cmd)) |
| 759 | { |
| 760 | double x0, y0; |
| 761 | unsigned cmd0 = last_vertex(&x0, &y0); |
| 762 | if (is_vertex(cmd0)) |
| 763 | { |
| 764 | if (calc_distance(x, y, x0, y0) > vertex_dist_epsilon) |
| 765 | { |
| 766 | if (is_move_to(cmd)) |
| 767 | cmd = path_cmd_line_to; |
| 768 | m_vertices.add_vertex(x, y, cmd); |
| 769 | } |
| 770 | } |
| 771 | else |
| 772 | { |
| 773 | if (is_stop(cmd0)) |
| 774 | { |
| 775 | cmd = path_cmd_move_to; |
| 776 | } |
| 777 | else |
| 778 | { |
| 779 | if (is_move_to(cmd)) |
| 780 | cmd = path_cmd_line_to; |
| 781 | } |
| 782 | m_vertices.add_vertex(x, y, cmd); |
| 783 | } |
| 784 | } |
| 785 | while (!is_stop(cmd = vs.vertex(&x, &y))) |
| 786 | { |
| 787 | m_vertices.add_vertex(x, |
| 788 | y, |
| 789 | is_move_to(cmd) ? unsigned(path_cmd_line_to) : cmd); |
| 790 | } |
| 791 | } |
| 792 | } |
| 793 | |
| 794 | // Concatenate polygon/polyline. |
| 795 | //-------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected