Skip to content

Commit 8fc09eb

Browse files
fsihDD Liu
authored andcommitted
Call add costume from library to fix bounding box issues with some library sprites
1 parent cc7a149 commit 8fc09eb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/containers/costume-library.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CostumeLibrary extends React.PureComponent {
3737
bitmapResolution: item.info.length > 2 ? item.info[2] : 1,
3838
skinId: null
3939
};
40-
this.props.vm.addCostume(item.md5, vmCostume);
40+
this.props.vm.addCostumeFromLibrary(item.md5, vmCostume);
4141
analytics.event({
4242
category: 'library',
4343
action: 'Select Costume',

src/containers/costume-tab.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,12 @@ class CostumeTab extends React.Component {
150150
handleDuplicateCostume (costumeIndex) {
151151
this.props.vm.duplicateCostume(costumeIndex);
152152
}
153-
handleNewCostume (costume) {
154-
this.props.vm.addCostume(costume.md5, costume);
153+
handleNewCostume (costume, fromCostumeLibrary) {
154+
if (fromCostumeLibrary) {
155+
this.props.vm.addCostumeFromLibrary(costume.md5, costume);
156+
} else {
157+
this.props.vm.addCostume(costume.md5, costume);
158+
}
155159
}
156160
handleNewBlankCostume () {
157161
const name = this.props.vm.editingTarget.isStage ?
@@ -173,7 +177,7 @@ class CostumeTab extends React.Component {
173177
bitmapResolution: item.info.length > 2 ? item.info[2] : 1,
174178
skinId: null
175179
};
176-
this.handleNewCostume(vmCostume);
180+
this.handleNewCostume(vmCostume, true /* fromCostumeLibrary */);
177181
}
178182
handleSurpriseBackdrop () {
179183
const item = backdropLibraryContent[Math.floor(Math.random() * backdropLibraryContent.length)];

0 commit comments

Comments
 (0)