From 7874ea9b1a6399ef89f2a9c4548d5f1de826f254 Mon Sep 17 00:00:00 2001 From: DD Date: Fri, 25 May 2018 16:54:54 -0400 Subject: [PATCH] Allow rotation centers with zeros --- src/import/load-costume.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/import/load-costume.js b/src/import/load-costume.js index a56fce111..4cd04323c 100644 --- a/src/import/load-costume.js +++ b/src/import/load-costume.js @@ -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