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.pull/36/head
parent
35a20ae260
commit
e381c70842
|
@ -167,21 +167,16 @@ public:
|
|||
layer.name = "text";
|
||||
dxf->writeLayer(&layer);
|
||||
|
||||
for(int i = 0; i < SK.style.n; i++) {
|
||||
Style *s = &SK.style.elem[i];
|
||||
std::set<uint32_t> usedStyles;
|
||||
|
||||
// check for using
|
||||
bool used = false;
|
||||
for(DxfFileWriter::BezierPath &path : writer->paths) {
|
||||
for(SBezier *sb : path.beziers) {
|
||||
if((uint32_t)sb->auxA != s->h.v) continue;
|
||||
used = true;
|
||||
break;
|
||||
usedStyles.insert((uint32_t)sb->auxA);
|
||||
}
|
||||
if(used) break;
|
||||
}
|
||||
if(!used) continue;
|
||||
|
||||
for(uint32_t v : usedStyles) {
|
||||
Style *s = Style::Get(hStyle{v});
|
||||
layer.name = s->DescriptionString();
|
||||
dxf->writeLayer(&layer);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue