diff --git a/CHANGELOG.md b/CHANGELOG.md index 20b6a973..1dd1ca8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,6 +94,8 @@ Bugs fixed: * Paste Transformed with a negative scale does not invert arcs. * The tangent arc now modifies the original entities instead of deleting them, such that their constraints are retained. + * When linking a sketch file, missing custom styles are now imported from + the linked file. 2.x --- diff --git a/src/file.cpp b/src/file.cpp index 23e8c81c..62dcffa8 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -732,7 +732,13 @@ bool SolveSpaceUI::LoadEntitiesFromFile(const Platform::Path &filename, EntityLi } else if(strcmp(line, "AddConstraint")==0) { } else if(strcmp(line, "AddStyle")==0) { - + // Linked file contains a style that we don't have yet, + // so import it. + if (SK.style.FindByIdNoOops(sv.s.h) == nullptr) { + SK.style.Add(&(sv.s)); + } + sv.s = {}; + Style::FillDefaultStyle(&sv.s); } else if(strcmp(line, VERSION_STRING)==0) { } else if(StrStartsWith(line, "Triangle ")) {