Call add costume from library to fix bounding box issues with some library sprites

This commit is contained in:
DD authored and DD Liu committed 2018-12-18 13:34:32 -05:00
1 parent cc7a149ac9
commit 8fc09eb050
2 files changed
+8 -4

No files matched your search

+1 -1
View File
@@ -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',
+7 -3
View File
@@ -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)];