From 936ff04b0f204094f0f6d28c57de48800a069975 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Wed, 26 Jul 2017 17:44:02 -0400 Subject: [PATCH] Fix setting Infinity to direction (#612) * Create rendered-target.js * Update math-util.js * Update rendered-target.js * Update math-util.js * Update rendered-target.js --- src/sprites/rendered-target.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sprites/rendered-target.js b/src/sprites/rendered-target.js index 1951700d3..bbf85231c 100644 --- a/src/sprites/rendered-target.js +++ b/src/sprites/rendered-target.js @@ -231,6 +231,9 @@ class RenderedTarget extends Target { if (this.isStage) { return; } + if (!isFinite(direction)) { + return; + } // Keep direction between -179 and +180. this.direction = MathUtil.wrapClamp(direction, -179, 180); if (this.renderer) {