Fix trying to get color info before pickX/Y was set

This commit is contained in:
Paul Kaplan committed 2019-03-07 11:17:48 -05:00
1 parent b2b4da2f68
commit f364994a46
1 file changed
+3 -1
+3 -1
View File
@@ -112,7 +112,9 @@ class Stage extends React.Component {
}
startColorPickingLoop () {
this.intervalId = setInterval(() => {
this.setState({colorInfo: this.getColorInfo(this.pickX, this.pickY)});
if (typeof this.pickX === 'number') {
this.setState({colorInfo: this.getColorInfo(this.pickX, this.pickY)});
}
}, 30);
}
stopColorPickingLoop () {