Fixed wrap not displaying the correct text.

This commit is contained in:
Beka Westberg
2019-05-25 16:51:42 -07:00
parent 7e7d706201
commit 378fbfd879

View File

@@ -264,6 +264,8 @@ Blockly.FieldAngle.prototype.onMouseMove = function(e) {
} else if (dy > 0) {
angle += 360;
}
// Do offsetting.
if (Blockly.FieldAngle.CLOCKWISE) {
angle = Blockly.FieldAngle.OFFSET + 360 - angle;
} else {
@@ -272,11 +274,18 @@ Blockly.FieldAngle.prototype.onMouseMove = function(e) {
if (angle > 360) {
angle -= 360;
}
// Do rounding.
if (Blockly.FieldAngle.ROUND) {
angle = Math.round(angle / Blockly.FieldAngle.ROUND) *
Blockly.FieldAngle.ROUND;
}
// Do wrapping.
if (angle > Blockly.FieldAngle.WRAP) {
angle -= 360;
}
// Update value.
var angleString = String(angle);
if (angleString != this.text_) {