| 104 | } |
| 105 | |
| 106 | void SVGLinesToString(Bounds bounds, glm::dvec2 size, glm::dvec2 offset, SVGLineSet lineSet, std::stringstream &svg) |
| 107 | { |
| 108 | for (auto &line : lineSet.lines) |
| 109 | { |
| 110 | if (line.size() > 1) |
| 111 | { |
| 112 | for (size_t i = 1; i < line.size(); i++) |
| 113 | { |
| 114 | glm::dvec2 a = rescale(line[i], bounds, size, offset); |
| 115 | glm::dvec2 b = rescale(line[i - 1], bounds, size, offset); |
| 116 | |
| 117 | svgMakeLine(a, b, svg, lineSet.color); |
| 118 | } |
| 119 | } |
| 120 | else |
| 121 | { |
| 122 | glm::dvec2 a = rescale(line[0], bounds, size, offset); |
| 123 | svg << "<circle cx = \"" << a.x << "\" cy = \"" << a.y << "\" r = \"3\" style = \"stroke:rgb(0,0,255);stroke-width:2\" />"; |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | std::string makeSVGLines(SVGDrawing drawing) |
| 129 | { |
no test coverage detected