Merge pull request #4090 from fsih/addCostumeFromLibrary
Call add costume from library to fix bounding box issues with some library sprites
This commit is contained in:
2 files changed
+8
-4
No files matched your search
@@ -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',
|
||||
|
||||
@@ -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)];
|
||||
|
||||
Reference in new issue
Block a user