Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jan 8, 2017
2 parents 00d359e + 695c706 commit c2ce2a5
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/web/widgets/Visualizer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,24 @@ class VisualizerWidget extends Component {
};

this.setState(nextState, () => {
this.visualizer && this.visualizer.load(name, gcode, ({ bbox }) => {
// bounding box
pubsub.publish('gcode:bbox', bbox);
if (!capable.view3D) {
return;
}

this.setState({
gcode: {
...this.state.gcode,
loading: false,
rendering: false,
ready: true,
bbox: bbox
}
delay(0).then(() => {
this.visualizer.load(name, gcode, ({ bbox }) => {
// bounding box
pubsub.publish('gcode:bbox', bbox);

this.setState({
gcode: {
...this.state.gcode,
loading: false,
rendering: false,
ready: true,
bbox: bbox
}
});
});
});
});
Expand Down

0 comments on commit c2ce2a5

Please sign in to comment.