Add check when removing the baseId prefix
This commit is contained in:
parent
0fcb1d62df
commit
4570c93837
1 changed files with 8 additions and 6 deletions
|
@ -103,12 +103,14 @@ namespace Kanimaji
|
||||||
return std::string_view(node.attribute("id").as_string()).contains("StrokeNumbers");
|
return std::string_view(node.attribute("id").as_string()).contains("StrokeNumbers");
|
||||||
}));
|
}));
|
||||||
|
|
||||||
pugi::xml_node pathsContainer = svg.find_child([](pugi::xml_node& node) {
|
pugi::xml_node pathsGroup = svg.find_child([](pugi::xml_node& node) {
|
||||||
return std::string_view(node.attribute("id").as_string()).contains("StrokePaths");
|
return std::string_view(node.attribute("id").as_string()).contains("StrokePaths");
|
||||||
});
|
});
|
||||||
pathsContainer.attribute("style") = "fill:none;visibility:hidden;";
|
pathsGroup.attribute("style") = "fill:none;visibility:hidden;";
|
||||||
std::string baseId = pathsContainer.attribute("id").as_string();
|
std::string baseId = pathsGroup.attribute("id").as_string();
|
||||||
baseId.erase(0, baseId.find('_') + 1);
|
if (auto pos = baseId.find('_'); pos != baseId.npos) {
|
||||||
|
baseId.erase(0, pos + 1);
|
||||||
|
}
|
||||||
|
|
||||||
// 1st pass for getting information
|
// 1st pass for getting information
|
||||||
double totalLength = 0.0;
|
double totalLength = 0.0;
|
||||||
|
@ -159,8 +161,8 @@ namespace Kanimaji
|
||||||
|
|
||||||
std::string id = idAttr.as_string();
|
std::string id = idAttr.as_string();
|
||||||
std::string css = id;
|
std::string css = id;
|
||||||
if (auto colonPos = css.find(':'); colonPos != css.npos) {
|
if (auto pos = css.find(':'); pos != css.npos) {
|
||||||
css.replace(css.find(":"), 1, "\\:");
|
css.replace(pos, 1, "\\:");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string pathId = id;
|
std::string pathId = id;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue