From 299c5c42259f2520a75262b12f6fc45d397ec177 Mon Sep 17 00:00:00 2001 From: DD <liudi08@gmail.com> Date: Fri, 27 Apr 2018 17:23:05 -0400 Subject: [PATCH] Take image format --- src/containers/paint-editor-wrapper.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/containers/paint-editor-wrapper.jsx b/src/containers/paint-editor-wrapper.jsx index decb5c85d..514f4b5bc 100644 --- a/src/containers/paint-editor-wrapper.jsx +++ b/src/containers/paint-editor-wrapper.jsx @@ -55,7 +55,8 @@ class PaintEditorWrapper extends React.Component { } PaintEditorWrapper.propTypes = { - imageId: PropTypes.string, + imageFormat: PropTypes.string.isRequired, + imageId: PropTypes.string.isRequired, name: PropTypes.string, rotationCenterX: PropTypes.number, rotationCenterY: PropTypes.number, @@ -71,11 +72,13 @@ const mapStateToProps = (state, {selectedCostumeIndex}) => { } = state.targets; const target = editingTarget && sprites[editingTarget] ? sprites[editingTarget] : stage; 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 { name: costume && costume.name, rotationCenterX: costume && costume.rotationCenterX / resolution, rotationCenterY: costume && costume.rotationCenterY / resolution, + imageFormat: costume.dataFormat, imageId: editingTarget && `${editingTarget}${costume.skinId}`, vm: state.vm }; -- GitLab