backport from master to support unsigned types
This commit is contained in:
parent
449be47e91
commit
83c478875f
@ -21,6 +21,10 @@ tree.Dimension.prototype = {
|
||||
|
||||
return this;
|
||||
},
|
||||
round: function() {
|
||||
this.value = Math.round(this.value);
|
||||
return this;
|
||||
},
|
||||
toColor: function() {
|
||||
return new tree.Color([this.value, this.value, this.value]);
|
||||
},
|
||||
|
@ -174,6 +174,13 @@ tree.Reference.validValue = function(env, selector, value) {
|
||||
}
|
||||
} else if (tree.Reference.selector(selector).type == 'expression') {
|
||||
return true;
|
||||
} else if (tree.Reference.selector(selector).type === 'unsigned') {
|
||||
if (value.value[0].is === 'float') {
|
||||
value.value[0].round();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (tree.Reference.selector(selector).validate) {
|
||||
var valid = false;
|
||||
|
Loading…
Reference in New Issue
Block a user