From 00619316868363c1ef1bbd541ca1102383a1d79c Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 27 May 2019 07:41:01 -0700 Subject: [PATCH] Change applicable locations to use the modulo assignment operator. --- core/field_angle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/field_angle.js b/core/field_angle.js index 0e6f05be5..7f521ec9d 100644 --- a/core/field_angle.js +++ b/core/field_angle.js @@ -307,7 +307,7 @@ Blockly.FieldAngle.prototype.updateGraph_ = function() { } // Always display the input (i.e. getText) even if it is invalid. var angleDegrees = Number(this.getText()) + Blockly.FieldAngle.OFFSET; - angleDegrees = angleDegrees % 360; + angleDegrees %= 360; var angleRadians = Blockly.utils.toRadians(angleDegrees); var path = ['M ', Blockly.FieldAngle.HALF, ',', Blockly.FieldAngle.HALF]; var x2 = Blockly.FieldAngle.HALF; @@ -347,7 +347,7 @@ Blockly.FieldAngle.prototype.doClassValidation_ = function(newValue) { return null; } var n = parseFloat(newValue || 0); - n = n % 360; + n %= 360; if (n < 0) { n += 360; }