-------------------------------------------------------------
| 686 | |
| 687 | //------------------------------------------------------------- |
| 688 | void parser::parse_poly(const char** attr, bool close_flag) |
| 689 | { |
| 690 | int i; |
| 691 | double x = 0.0; |
| 692 | double y = 0.0; |
| 693 | |
| 694 | m_path.begin_path(); |
| 695 | for(i = 0; attr[i]; i += 2) |
| 696 | { |
| 697 | if(!parse_attr(attr[i], attr[i + 1])) |
| 698 | { |
| 699 | if(strcmp(attr[i], "points") == 0) |
| 700 | { |
| 701 | m_tokenizer.set_path_str(attr[i + 1]); |
| 702 | if(!m_tokenizer.next()) |
| 703 | { |
| 704 | throw exception("parse_poly: Too few coordinates"); |
| 705 | } |
| 706 | x = m_tokenizer.last_number(); |
| 707 | if(!m_tokenizer.next()) |
| 708 | { |
| 709 | throw exception("parse_poly: Too few coordinates"); |
| 710 | } |
| 711 | y = m_tokenizer.last_number(); |
| 712 | m_path.move_to(x, y); |
| 713 | while(m_tokenizer.next()) |
| 714 | { |
| 715 | x = m_tokenizer.last_number(); |
| 716 | if(!m_tokenizer.next()) |
| 717 | { |
| 718 | throw exception("parse_poly: Odd number of coordinates"); |
| 719 | } |
| 720 | y = m_tokenizer.last_number(); |
| 721 | m_path.line_to(x, y); |
| 722 | } |
| 723 | } |
| 724 | } |
| 725 | } |
| 726 | if(close_flag) |
| 727 | { |
| 728 | m_path.close_subpath(); |
| 729 | } |
| 730 | m_path.end_path(); |
| 731 | } |
| 732 | |
| 733 | //------------------------------------------------------------- |
| 734 | void parser::parse_transform(const char* str) |
no test coverage detected