diff --git a/src/containers/costume-tab.jsx b/src/containers/costume-tab.jsx index 641d77380d01d254d91b3f95ac3b38234e91dd24..1b8b2b99314e8f9a91b32e2139f37d5c0ccbe010 100644 --- a/src/containers/costume-tab.jsx +++ b/src/containers/costume-tab.jsx @@ -194,10 +194,12 @@ class CostumeTab extends React.Component { setFileInput (input) { this.fileInput = input; } - formatCostumeDetails (size) { + formatCostumeDetails (size, optResolution) { + const resolution = optResolution ? optResolution : 1; + // Convert size to stage units by dividing by resolution // Round up width and height for scratch-flash compatibility // https://github.com/LLK/scratch-flash/blob/9fbac92ef3d09ceca0c0782f8a08deaa79e4df69/src/ui/media/MediaInfo.as#L224-L237 - return `${Math.ceil(size[0])} x ${Math.ceil(size[1])}`; + return `${Math.ceil(size[0] / resolution)} x ${Math.ceil(size[1] / resolution)}`; } render () { const { @@ -232,7 +234,7 @@ class CostumeTab extends React.Component { const costumeData = (target.costumes || []).map(costume => ({ name: costume.name, assetId: costume.assetId, - details: costume.size ? this.formatCostumeDetails(costume.size) : null + details: costume.size ? this.formatCostumeDetails(costume.size, costume.bitmapResolution) : null })); return (