Browse Source

Editor: Downstream ui.js.

Mr.doob 9 năm trước cách đây
mục cha
commit
ce5cd12786
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      editor/js/libs/ui.js

+ 6 - 1
editor/js/libs/ui.js

@@ -763,7 +763,7 @@ UI.Number = function ( number ) {
 
 		}
 
-		scope.setValue( parseFloat( value ) );
+		scope.setValue( value );
 
 	}
 
@@ -805,6 +805,11 @@ UI.Number.prototype.setValue = function ( value ) {
 
 	if ( value !== undefined ) {
 
+		value = parseFloat( value );
+
+		if ( value < this.min ) value = this.min;
+		if ( value > this.max ) value = this.max;
+
 		this.value = value;
 		this.dom.value = value.toFixed( this.precision );