🐛 Prevent draft method from forcing render of hidden part
This commit is contained in:
parent
f96ccc95e7
commit
45498afbba
2 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,6 @@ const Part = props => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const focusCoords = (p, i) => {
|
const focusCoords = (p, i) => {
|
||||||
console.log("focus coords", p, i);
|
|
||||||
let pathString = `M ${p.x} ${props.part.topLeft.y} `;
|
let pathString = `M ${p.x} ${props.part.topLeft.y} `;
|
||||||
pathString += `L ${p.x} ${props.part.bottomRight.y} `;
|
pathString += `L ${p.x} ${props.part.bottomRight.y} `;
|
||||||
pathString += `M ${props.part.topLeft.x} ${p.y} `;
|
pathString += `M ${props.part.topLeft.x} ${p.y} `;
|
||||||
|
|
|
@ -141,7 +141,8 @@ Pattern.prototype.draft = function() {
|
||||||
method +
|
method +
|
||||||
"() was undefined. Did you forget to return the Part object?"
|
"() 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 {
|
} else {
|
||||||
this.parts[partName].render = false;
|
this.parts[partName].render = false;
|
||||||
}
|
}
|
||||||
|
@ -611,7 +612,7 @@ Pattern.prototype.getRenderProps = function() {
|
||||||
props.height = this.height;
|
props.height = this.height;
|
||||||
props.settings = this.settings;
|
props.settings = this.settings;
|
||||||
props.parts = {};
|
props.parts = {};
|
||||||
for (let p of Object.keys(this.parts)) {
|
for (let p in this.parts) {
|
||||||
if (this.parts[p].render) {
|
if (this.parts[p].render) {
|
||||||
props.parts[p] = {
|
props.parts[p] = {
|
||||||
paths: this.parts[p].paths,
|
paths: this.parts[p].paths,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue