Fix trying to get color info before pickX/Y was set
This commit is contained in:
1 parent
b2b4da2f68
commit
f364994a46
1 file changed
+3
-1
@@ -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 () {
|
||||
|
||||
Reference in new issue
Block a user