diff --git a/deps/agg/include/agg_conv_clipper.h b/deps/agg/include/agg_conv_clipper.h index d49d5e04c..1c8e74253 100755 --- a/deps/agg/include/agg_conv_clipper.h +++ b/deps/agg/include/agg_conv_clipper.h @@ -28,24 +28,24 @@ enum clipper_PolyFillType {clipper_even_odd, clipper_non_zero, clipper_positive, template class conv_clipper { - enum status { status_move_to, status_line_to, status_close_path, status_stop }; + enum status { status_move_to, status_line_to, status_stop }; typedef VSA source_a_type; typedef VSB source_b_type; typedef conv_clipper self_type; private: - source_a_type* m_src_a; - source_b_type* m_src_b; - status m_status; - int m_vertex; - int m_contour; - int m_scaling_factor; - clipper_op_e m_operation; + source_a_type* m_src_a; + source_b_type* m_src_b; + status m_status; + int m_vertex; + int m_contour; + int m_scaling_factor; + clipper_op_e m_operation; pod_bvector m_vertex_accumulator; - ClipperLib::Polygons m_poly_a; - ClipperLib::Polygons m_poly_b; - ClipperLib::Polygons m_result; - ClipperLib::Clipper m_clipper; + ClipperLib::Polygons m_poly_a; + ClipperLib::Polygons m_poly_b; + ClipperLib::Polygons m_result; + ClipperLib::Clipper m_clipper; clipper_PolyFillType m_subjFillType; clipper_PolyFillType m_clipFillType; double start_x_; @@ -288,7 +288,7 @@ unsigned conv_clipper::vertex(double *x, double *y) { if( next_vertex( x, y ) ) { - m_status = status_line_to; + m_status =status_line_to; start_x_ = *x; start_y_ = *y; return path_cmd_move_to; @@ -297,36 +297,25 @@ unsigned conv_clipper::vertex(double *x, double *y) { *x = start_x_; *y = start_y_; - m_status = status_close_path; - return path_cmd_line_to; + m_status = status_stop; + return path_cmd_end_poly | path_flags_close; } } else return path_cmd_stop; } - else if ( m_status == status_close_path) - { - *x = 0; - *y = 0; - m_status = status_move_to; - return path_cmd_end_poly | path_flags_close; - } - else if (m_status == status_stop) - { - return path_cmd_stop; - } else { - if( next_vertex( x, y ) ) + if( next_vertex( x, y ) ) { return path_cmd_line_to; } else { + m_status = status_move_to; *x = start_x_; *y = start_y_; - m_status = status_close_path; - return path_cmd_line_to;//path_cmd_end_poly | path_flags_close; + return path_cmd_end_poly | path_flags_close; } } }