1
0
Fork 0

🐛 Prevent draft method from forcing render of hidden part

This commit is contained in:
Joost De Cock 2019-07-08 14:46:58 +02:00 committed by Joost De Cock
parent f96ccc95e7
commit 45498afbba
2 changed files with 3 additions and 3 deletions

View file

@ -141,7 +141,8 @@ Pattern.prototype.draft = function() {
method +
"() was undefined. Did you forget to return the Part object?"
);
this.parts[partName].render = this.wants(partName);
this.parts[partName].render =
this.parts[partName].render === false ? false : this.wants(partName);
} else {
this.parts[partName].render = false;
}
@ -611,7 +612,7 @@ Pattern.prototype.getRenderProps = function() {
props.height = this.height;
props.settings = this.settings;
props.parts = {};
for (let p of Object.keys(this.parts)) {
for (let p in this.parts) {
if (this.parts[p].render) {
props.parts[p] = {
paths: this.parts[p].paths,