mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Fix angle picker when 'Infinity' is typed in.
Previously 'NaN' would be generated, which is not a legal value.
This commit is contained in:
@@ -340,11 +340,10 @@ Blockly.FieldAngle.prototype.updateGraph_ = function() {
|
||||
* @override
|
||||
*/
|
||||
Blockly.FieldAngle.prototype.doClassValidation_ = function(opt_newValue) {
|
||||
if (isNaN(opt_newValue)) {
|
||||
var n = Number(opt_newValue) % 360;
|
||||
if (isNaN(n)) {
|
||||
return null;
|
||||
}
|
||||
var n = parseFloat(opt_newValue || 0);
|
||||
n %= 360;
|
||||
if (n < 0) {
|
||||
n += 360;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user