MCPcopy Create free account
hub / github.com/MapServer/MapServer / arc_to

Method arc_to

renderers/agg/include/agg_path_storage.h:939–983  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937 //------------------------------------------------------------------------
938 template<class VC>
939 void path_base<VC>::arc_to(double rx, double ry,
940 double angle,
941 bool large_arc_flag,
942 bool sweep_flag,
943 double x, double y)
944 {
945 if(m_vertices.total_vertices() && is_vertex(m_vertices.last_command()))
946 {
947 const double epsilon = 1e-30;
948 double x0 = 0.0;
949 double y0 = 0.0;
950 m_vertices.last_vertex(&x0, &y0);
951
952 rx = fabs(rx);
953 ry = fabs(ry);
954
955 // Ensure radii are valid
956 //-------------------------
957 if(rx < epsilon || ry < epsilon)
958 {
959 line_to(x, y);
960 return;
961 }
962
963 if(calc_distance(x0, y0, x, y) < epsilon)
964 {
965 // If the endpoints (x, y) and (x0, y0) are identical, then this
966 // is equivalent to omitting the elliptical arc segment entirely.
967 return;
968 }
969 bezier_arc_svg a(x0, y0, rx, ry, angle, large_arc_flag, sweep_flag, x, y);
970 if(a.radii_ok())
971 {
972 join_path(a);
973 }
974 else
975 {
976 line_to(x, y);
977 }
978 }
979 else
980 {
981 move_to(x, y);
982 }
983 }
984
985 //------------------------------------------------------------------------
986 template<class VC>

Callers

nothing calls this directly

Calls 6

is_vertexFunction · 0.85
calc_distanceFunction · 0.85
radii_okMethod · 0.80
total_verticesMethod · 0.45
last_commandMethod · 0.45
last_vertexMethod · 0.45

Tested by

no test coverage detected