mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Allow rotation centers with zeros
This commit is contained in:
parent
a85f641d25
commit
7874ea9b1a
1 changed files with 5 additions and 1 deletions
|
@ -24,7 +24,11 @@ const loadCostumeFromAsset = function (costume, costumeAsset, runtime, optVersio
|
||||||
}
|
}
|
||||||
const AssetType = runtime.storage.AssetType;
|
const AssetType = runtime.storage.AssetType;
|
||||||
let rotationCenter;
|
let rotationCenter;
|
||||||
if (costume.rotationCenterX && costume.rotationCenterY && costume.bitmapResolution) {
|
// Use provided rotation center and resolution if they are defined. Bitmap resolution
|
||||||
|
// should only ever be 1 or 2.
|
||||||
|
if (typeof costume.rotationCenterX === 'number' && !isNaN(costume.rotationCenterX) &&
|
||||||
|
typeof costume.rotationCenterY === 'number' && !isNaN(costume.rotationCenterY) &&
|
||||||
|
costume.bitmapResolution) {
|
||||||
rotationCenter = [
|
rotationCenter = [
|
||||||
costume.rotationCenterX / costume.bitmapResolution,
|
costume.rotationCenterX / costume.bitmapResolution,
|
||||||
costume.rotationCenterY / costume.bitmapResolution
|
costume.rotationCenterY / costume.bitmapResolution
|
||||||
|
|
Loading…
Reference in a new issue