From 8fc09eb050f819d0970f6561b787e06e7fd98cf1 Mon Sep 17 00:00:00 2001 From: DD Date: Fri, 14 Dec 2018 14:26:09 -0500 Subject: [PATCH] Call add costume from library to fix bounding box issues with some library sprites --- src/containers/costume-library.jsx | 2 +- src/containers/costume-tab.jsx | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/containers/costume-library.jsx b/src/containers/costume-library.jsx index 070c9f4b9..aafe18bc3 100644 --- a/src/containers/costume-library.jsx +++ b/src/containers/costume-library.jsx @@ -37,7 +37,7 @@ class CostumeLibrary extends React.PureComponent { bitmapResolution: item.info.length > 2 ? item.info[2] : 1, skinId: null }; - this.props.vm.addCostume(item.md5, vmCostume); + this.props.vm.addCostumeFromLibrary(item.md5, vmCostume); analytics.event({ category: 'library', action: 'Select Costume', diff --git a/src/containers/costume-tab.jsx b/src/containers/costume-tab.jsx index 321c25c9a..5df459150 100644 --- a/src/containers/costume-tab.jsx +++ b/src/containers/costume-tab.jsx @@ -150,8 +150,12 @@ class CostumeTab extends React.Component { handleDuplicateCostume (costumeIndex) { this.props.vm.duplicateCostume(costumeIndex); } - handleNewCostume (costume) { - this.props.vm.addCostume(costume.md5, costume); + handleNewCostume (costume, fromCostumeLibrary) { + if (fromCostumeLibrary) { + this.props.vm.addCostumeFromLibrary(costume.md5, costume); + } else { + this.props.vm.addCostume(costume.md5, costume); + } } handleNewBlankCostume () { const name = this.props.vm.editingTarget.isStage ? @@ -173,7 +177,7 @@ class CostumeTab extends React.Component { bitmapResolution: item.info.length > 2 ? item.info[2] : 1, skinId: null }; - this.handleNewCostume(vmCostume); + this.handleNewCostume(vmCostume, true /* fromCostumeLibrary */); } handleSurpriseBackdrop () { const item = backdropLibraryContent[Math.floor(Math.random() * backdropLibraryContent.length)];