disable propagates with and height too

This commit is contained in:
2019-06-20 15:57:24 +02:00
parent 587cf72fa3
commit 7eb8e5886d

View File

@@ -14,12 +14,24 @@ export default class Disable extends Node {
image: {
type: 'Image',
},
width: {
type: 'Number',
},
height: {
type: 'Number',
},
}, {});
}
async _update() {
if (!this.in.disabled.value) {
this.out.image.value = this.in.image.value;
if (this.out.width.value !== this.out.image.value.width) {
this.out.width.value = this.out.image.value.width;
}
if (this.out.height.value !== this.out.image.value.height) {
this.out.height.value = this.out.image.value.height;
}
}
}