From a4578ba0862f674686df2d534426f5c80ba421c4 Mon Sep 17 00:00:00 2001 From: Andrew Sliwinski Date: Thu, 2 Mar 2017 11:21:01 -0500 Subject: [PATCH] Default bitmapResolution to 1 if not provided in costume metadata (#485) * Default bitmapResolution to 1 if not provided in costume metadata. Resolves GH-484 --- src/sprites/rendered-target.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sprites/rendered-target.js b/src/sprites/rendered-target.js index 9c64b9aa0..d934f72eb 100644 --- a/src/sprites/rendered-target.js +++ b/src/sprites/rendered-target.js @@ -428,16 +428,17 @@ RenderedTarget.prototype.updateAllDrawableProperties = function () { if (this.renderer) { var renderedDirectionScale = this._getRenderedDirectionAndScale(); var costume = this.sprite.costumes[this.currentCostume]; + var bitmapResolution = costume.bitmapResolution || 1; var props = { position: [this.x, this.y], direction: renderedDirectionScale.direction, scale: renderedDirectionScale.scale, visible: this.visible, skin: costume.skin, - costumeResolution: costume.bitmapResolution, + costumeResolution: bitmapResolution, rotationCenter: [ - costume.rotationCenterX / costume.bitmapResolution, - costume.rotationCenterY / costume.bitmapResolution + costume.rotationCenterX / bitmapResolution, + costume.rotationCenterY / bitmapResolution ] }; for (var effectName in this.effects) {