mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Merge pull request #1171 from fsih/rotationCenterZeros
Allow rotation centers with zeros
This commit is contained in:
commit
34587403e6
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;
|
||||
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 = [
|
||||
costume.rotationCenterX / costume.bitmapResolution,
|
||||
costume.rotationCenterY / costume.bitmapResolution
|
||||
|
|
Loading…
Reference in a new issue