mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
svg: prevent garbage data on empty path
This commit is contained in:
@@ -334,23 +334,25 @@ void SvgSerializer::write(path_object& p, const TopoDS_Shape& comp_or_wire, boos
|
|||||||
first_wire = false;
|
first_wire = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
path.add("\"");
|
if (!path.empty()) {
|
||||||
|
|
||||||
if (dash_array) {
|
|
||||||
path.add(" stroke-dasharray=\"");
|
|
||||||
bool first = true;
|
|
||||||
for (auto& d : *dash_array) {
|
|
||||||
if (!first) {
|
|
||||||
path.add(" ");
|
|
||||||
}
|
|
||||||
first = false;
|
|
||||||
radii.push_back(path.add(d));
|
|
||||||
}
|
|
||||||
path.add("\"");
|
path.add("\"");
|
||||||
}
|
|
||||||
|
|
||||||
path.add("/>\n");
|
if (dash_array) {
|
||||||
p.second.push_back(path);
|
path.add(" stroke-dasharray=\"");
|
||||||
|
bool first = true;
|
||||||
|
for (auto& d : *dash_array) {
|
||||||
|
if (!first) {
|
||||||
|
path.add(" ");
|
||||||
|
}
|
||||||
|
first = false;
|
||||||
|
radii.push_back(path.add(d));
|
||||||
|
}
|
||||||
|
path.add("\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
path.add("/>\n");
|
||||||
|
p.second.push_back(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SvgSerializer::path_object& SvgSerializer::start_path(const gp_Pln& pln, IfcUtil::IfcBaseEntity* storey, const std::string& id) {
|
SvgSerializer::path_object& SvgSerializer::start_path(const gp_Pln& pln, IfcUtil::IfcBaseEntity* storey, const std::string& id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user