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

Method parse_line

renderers/agg/src/agg_svg_parser.cpp:661–684  ·  view source on GitHub ↗

-------------------------------------------------------------

Source from the content-addressed store, hash-verified

659
660 //-------------------------------------------------------------
661 void parser::parse_line(const char** attr)
662 {
663 int i;
664 double x1 = 0.0;
665 double y1 = 0.0;
666 double x2 = 0.0;
667 double y2 = 0.0;
668
669 m_path.begin_path();
670 for(i = 0; attr[i]; i += 2)
671 {
672 if(!parse_attr(attr[i], attr[i + 1]))
673 {
674 if(strcmp(attr[i], "x1") == 0) x1 = parse_double(attr[i + 1]);
675 if(strcmp(attr[i], "y1") == 0) y1 = parse_double(attr[i + 1]);
676 if(strcmp(attr[i], "x2") == 0) x2 = parse_double(attr[i + 1]);
677 if(strcmp(attr[i], "y2") == 0) y2 = parse_double(attr[i + 1]);
678 }
679 }
680
681 m_path.move_to(x1, y1);
682 m_path.line_to(x2, y2);
683 m_path.end_path();
684 }
685
686
687 //-------------------------------------------------------------

Callers 1

start_elementMethod · 0.95

Calls 5

parse_doubleFunction · 0.85
begin_pathMethod · 0.80
end_pathMethod · 0.80
move_toMethod · 0.45
line_toMethod · 0.45

Tested by

no test coverage detected