From 32d0ba403a85160c777ccbce7507d027c633ddd1 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Mon, 27 Mar 2017 15:05:28 -0400 Subject: [PATCH 1/2] Use new addCostume API --- src/containers/backdrop-library.jsx | 6 +++--- src/containers/costume-library.jsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/containers/backdrop-library.jsx b/src/containers/backdrop-library.jsx index 7291663e7..4927fb219 100644 --- a/src/containers/backdrop-library.jsx +++ b/src/containers/backdrop-library.jsx @@ -15,15 +15,15 @@ class BackdropLibrary extends React.Component { } handleItemSelect (item) { const vmBackdrop = { - skin: `https://cdn.assets.scratch.mit.edu/internalapi/asset/${item.md5}/get/`, name: item.name, rotationCenterX: item.info[0] && item.info[0] / 2, - rotationCenterY: item.info[1] && item.info[1] / 2 + rotationCenterY: item.info[1] && item.info[1] / 2, + skinId: null }; if (item.info.length > 2) { vmBackdrop.bitmapResolution = item.info[2]; } - this.props.vm.addBackdrop(vmBackdrop); + this.props.vm.addBackdrop(item.md5, vmBackdrop); } render () { return ( diff --git a/src/containers/costume-library.jsx b/src/containers/costume-library.jsx index 74a661fa1..368229946 100644 --- a/src/containers/costume-library.jsx +++ b/src/containers/costume-library.jsx @@ -15,15 +15,15 @@ class CostumeLibrary extends React.Component { } handleItemSelected (item) { const vmCostume = { - skin: `https://cdn.assets.scratch.mit.edu/internalapi/asset/${item.md5}/get/`, name: item.name, rotationCenterX: item.info[0], - rotationCenterY: item.info[1] + rotationCenterY: item.info[1], + skinId: null }; if (item.info.length > 2) { vmCostume.bitmapResolution = item.info[2]; } - this.props.vm.addCostume(vmCostume); + this.props.vm.addCostume(item.md5, vmCostume); } render () { return ( From 7b2166fb4a4c61f592b854650003ee889fb74fd3 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Fri, 31 Mar 2017 12:36:18 -0400 Subject: [PATCH 2/2] Include default bitmap resolution as required by the vm --- src/containers/backdrop-library.jsx | 4 +--- src/containers/costume-library.jsx | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/containers/backdrop-library.jsx b/src/containers/backdrop-library.jsx index 4927fb219..e218d1de8 100644 --- a/src/containers/backdrop-library.jsx +++ b/src/containers/backdrop-library.jsx @@ -18,11 +18,9 @@ class BackdropLibrary extends React.Component { name: item.name, rotationCenterX: item.info[0] && item.info[0] / 2, rotationCenterY: item.info[1] && item.info[1] / 2, + bitmapResolution: item.info.length > 2 ? item.info[2] : 1, skinId: null }; - if (item.info.length > 2) { - vmBackdrop.bitmapResolution = item.info[2]; - } this.props.vm.addBackdrop(item.md5, vmBackdrop); } render () { diff --git a/src/containers/costume-library.jsx b/src/containers/costume-library.jsx index 368229946..d6ecdd0ff 100644 --- a/src/containers/costume-library.jsx +++ b/src/containers/costume-library.jsx @@ -18,11 +18,9 @@ class CostumeLibrary extends React.Component { name: item.name, rotationCenterX: item.info[0], rotationCenterY: item.info[1], + bitmapResolution: item.info.length > 2 ? item.info[2] : 1, skinId: null }; - if (item.info.length > 2) { - vmCostume.bitmapResolution = item.info[2]; - } this.props.vm.addCostume(item.md5, vmCostume); } render () {