diff --git a/src/containers/costume-tab.jsx b/src/containers/costume-tab.jsx index 65aced936709cfcae184fec8669bea514f614835..843380f29642bbf06dbcd5a74be02e549d1e9b41 100644 --- a/src/containers/costume-tab.jsx +++ b/src/containers/costume-tab.jsx @@ -84,6 +84,7 @@ class CostumeTab extends React.Component { const addMessage = target.isStage ? addBackdropMsg : addCostumeMsg; const addFunc = target.isStage ? onNewBackdropClick : onNewCostumeClick; + const costume = this.props.vm.editingTarget.sprite.costumes[this.state.selectedCostumeIndex]; return ( <AssetPanel @@ -97,15 +98,15 @@ class CostumeTab extends React.Component { onDeleteClick={this.handleDeleteCostume} onItemClick={this.handleSelectCostume} > - {target.costumes ? - <PaintEditor - svg={this.props.vm.getCostumeSvg(this.state.selectedCostumeIndex)} - rotationCenterX={this.props.vm.editingTarget.sprite.costumes[this.state.selectedCostumeIndex].rotationCenterX} - rotationCenterY={this.props.vm.editingTarget.sprite.costumes[this.state.selectedCostumeIndex].rotationCenterY} - onUpdateSvg={this.handleUpdateSvg} - /> - : null - } + {target.costumes ? + <PaintEditor + rotationCenterX={costume.rotationCenterX} + rotationCenterY={costume.rotationCenterY} + svg={this.props.vm.getCostumeSvg(this.state.selectedCostumeIndex)} + onUpdateSvg={this.handleUpdateSvg} + /> : + null + } </AssetPanel> ); }