mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
#2942 Escape SVG text labels
This commit is contained in:
@@ -1344,7 +1344,8 @@ void SvgSerializer::write(const geometry_data& data) {
|
||||
labels.push_back(ss.str() + "m");
|
||||
|
||||
for (auto lit = labels.begin(); lit != labels.end(); ++lit) {
|
||||
const auto& l = *lit;
|
||||
auto l = *lit;
|
||||
IfcUtil::escape_xml(l);
|
||||
double dy = labels.begin() == lit
|
||||
? 0.35 - (labels.size() - 1.) / 2.
|
||||
: 1.0; // <- dy is relative to the previous text element, so
|
||||
@@ -1512,7 +1513,8 @@ void SvgSerializer::write(const geometry_data& data) {
|
||||
ycoords.push_back(path.add(anchor_pt->Y()));
|
||||
path.add("\">");
|
||||
for (auto lit = labels.begin(); lit != labels.end(); ++lit) {
|
||||
const auto& l = *lit;
|
||||
auto l = *lit;
|
||||
IfcUtil::escape_xml(l);
|
||||
double dy = labels.begin() == lit
|
||||
? 0.35 - (labels.size() - 1.) / 2.
|
||||
: 1.0; // <- dy is relative to the previous text element, so
|
||||
@@ -1629,7 +1631,8 @@ void SvgSerializer::write(const geometry_data& data) {
|
||||
}
|
||||
path.add(">");
|
||||
for (auto lit = labels.begin(); lit != labels.end(); ++lit) {
|
||||
const auto& l = *lit;
|
||||
auto l = *lit;
|
||||
IfcUtil::escape_xml(l);
|
||||
double dy = labels.begin() == lit
|
||||
? 0.35 - (labels.size() - 1.) / 2.
|
||||
: 1.0; // <- dy is relative to the previous text element, so
|
||||
@@ -1967,7 +1970,8 @@ void SvgSerializer::addTextAnnotations(const drawing_key& k) {
|
||||
std::vector<std::string> labels{ desc };
|
||||
|
||||
for (auto lit = labels.begin(); lit != labels.end(); ++lit) {
|
||||
const auto& l = *lit;
|
||||
auto l = *lit;
|
||||
IfcUtil::escape_xml(l);
|
||||
double dy = labels.begin() == lit
|
||||
? 0.0 // align bottom
|
||||
: 1.0; // <- dy is relative to the previous text element, so
|
||||
|
||||
Reference in New Issue
Block a user