Skip to content
Snippets Groups Projects
Commit 299c5c42 authored by DD's avatar DD Committed by DD Liu
Browse files

Take image format

parent 1f4388ca
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,8 @@ class PaintEditorWrapper extends React.Component { ...@@ -55,7 +55,8 @@ class PaintEditorWrapper extends React.Component {
} }
PaintEditorWrapper.propTypes = { PaintEditorWrapper.propTypes = {
imageId: PropTypes.string, imageFormat: PropTypes.string.isRequired,
imageId: PropTypes.string.isRequired,
name: PropTypes.string, name: PropTypes.string,
rotationCenterX: PropTypes.number, rotationCenterX: PropTypes.number,
rotationCenterY: PropTypes.number, rotationCenterY: PropTypes.number,
...@@ -71,11 +72,13 @@ const mapStateToProps = (state, {selectedCostumeIndex}) => { ...@@ -71,11 +72,13 @@ const mapStateToProps = (state, {selectedCostumeIndex}) => {
} = state.targets; } = state.targets;
const target = editingTarget && sprites[editingTarget] ? sprites[editingTarget] : stage; const target = editingTarget && sprites[editingTarget] ? sprites[editingTarget] : stage;
const costume = target && target.costumes[selectedCostumeIndex]; const costume = target && target.costumes[selectedCostumeIndex];
const resolution = costume && costume.dataFormat === 'png' ? costume.bitmapResolution / 2 : 1; const resolution = costume &&
(costume.dataFormat === 'png' && costume.dataFormat === 'jpg') ? costume.bitmapResolution / 2 : 1;
return { return {
name: costume && costume.name, name: costume && costume.name,
rotationCenterX: costume && costume.rotationCenterX / resolution, rotationCenterX: costume && costume.rotationCenterX / resolution,
rotationCenterY: costume && costume.rotationCenterY / resolution, rotationCenterY: costume && costume.rotationCenterY / resolution,
imageFormat: costume.dataFormat,
imageId: editingTarget && `${editingTarget}${costume.skinId}`, imageId: editingTarget && `${editingTarget}${costume.skinId}`,
vm: state.vm vm: state.vm
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment