| 30 | |
| 31 | |
| 32 | void Svg::loadString(const std::string& str) { |
| 33 | if (handle) |
| 34 | nsvgDelete(handle); |
| 35 | |
| 36 | // nsvgParse modifies the input string |
| 37 | std::string strCopy = str; |
| 38 | handle = nsvgParse(&strCopy[0], "px", SVG_DPI); |
| 39 | std::string strEllip = string::ellipsize(str, 40); |
| 40 | if (!handle) |
| 41 | throw Exception("Failed to load SVG \"%s\"", strEllip.c_str()); |
| 42 | INFO("Loaded SVG \"%s\"", strEllip.c_str()); |
| 43 | } |
| 44 | |
| 45 | |
| 46 | math::Vec Svg::getSize() { |