Import missing styles from linked files.

pull/381/head
Bauke Conijn 2019-02-19 11:42:14 +01:00 committed by whitequark
parent 9e512882d1
commit 8d07a6b4f4
2 changed files with 9 additions and 1 deletions

View File

@ -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
---

View File

@ -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 ")) {