DXF export: always declare layers before using them.
Before this commit, the #s001-active-grp layer was not declared, and this broke some external software, such as Inkscape. See https://bugs.launchpad.net/inkscape/+bug/1472429 for details.
This commit is contained in:
parent
0b997e4c17
commit
4d2c773ee6
|
@ -175,21 +175,16 @@ public:
|
||||||
layer.name = "text";
|
layer.name = "text";
|
||||||
dxf->writeLayer(&layer);
|
dxf->writeLayer(&layer);
|
||||||
|
|
||||||
for(int i = 0; i < SK.style.n; i++) {
|
std::set<uint32_t> usedStyles;
|
||||||
Style *s = &SK.style.elem[i];
|
|
||||||
|
|
||||||
// check for using
|
|
||||||
bool used = false;
|
|
||||||
for(DxfFileWriter::BezierPath &path : writer->paths) {
|
for(DxfFileWriter::BezierPath &path : writer->paths) {
|
||||||
for(SBezier *sb : path.beziers) {
|
for(SBezier *sb : path.beziers) {
|
||||||
if((uint32_t)sb->auxA != s->h.v) continue;
|
usedStyles.insert((uint32_t)sb->auxA);
|
||||||
used = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if(used) break;
|
|
||||||
}
|
}
|
||||||
if(!used) continue;
|
|
||||||
|
|
||||||
|
for(uint32_t v : usedStyles) {
|
||||||
|
Style *s = Style::Get(hStyle{v});
|
||||||
layer.name = s->DescriptionString();
|
layer.name = s->DescriptionString();
|
||||||
dxf->writeLayer(&layer);
|
dxf->writeLayer(&layer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user