MCPcopy Create free account
hub / github.com/VCVRack/Rack / loadString

Method loadString

src/window/Svg.cpp:32–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31
32void 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
46math::Vec Svg::getSize() {

Callers

nothing calls this directly

Calls 2

ellipsizeFunction · 0.85
ExceptionClass · 0.85

Tested by

no test coverage detected