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

Method parse_rotate

renderers/agg/src/agg_svg_parser.cpp:829–850  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

827
828 //-------------------------------------------------------------
829 unsigned parser::parse_rotate(const char* str)
830 {
831 double args[3];
832 unsigned na = 0;
833 unsigned len = parse_transform_args(str, args, 3, &na);
834 if(na == 1)
835 {
836 m_path.transform().premultiply(trans_affine_rotation(deg2rad(args[0])));
837 }
838 else if(na == 3)
839 {
840 trans_affine t = trans_affine_translation(-args[1], -args[2]);
841 t *= trans_affine_rotation(deg2rad(args[0]));
842 t *= trans_affine_translation(args[1], args[2]);
843 m_path.transform().premultiply(t);
844 }
845 else
846 {
847 throw exception("parse_rotate: Invalid number of arguments");
848 }
849 return len;
850 }
851
852 //-------------------------------------------------------------
853 unsigned parser::parse_scale(const char* str)

Callers

nothing calls this directly

Calls 7

parse_transform_argsFunction · 0.85
deg2radFunction · 0.85
exceptionClass · 0.85
premultiplyMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected