Ver Fonte

Editor: Faster rotation.

Mr.doob há 9 anos atrás
pai
commit
8bf4a9e619
2 ficheiros alterados com 24 adições e 8 exclusões
  1. 3 3
      editor/js/Sidebar.Object.js
  2. 21 5
      editor/js/libs/ui.js

+ 3 - 3
editor/js/Sidebar.Object.js

@@ -109,9 +109,9 @@ Sidebar.Object = function ( editor ) {
 	// rotation
 
 	var objectRotationRow = new UI.Row();
-	var objectRotationX = new UI.Number().setUnit( '°' ).setWidth( '50px' ).onChange( update );
-	var objectRotationY = new UI.Number().setUnit( '°' ).setWidth( '50px' ).onChange( update );
-	var objectRotationZ = new UI.Number().setUnit( '°' ).setWidth( '50px' ).onChange( update );
+	var objectRotationX = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
+	var objectRotationY = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
+	var objectRotationZ = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
 
 	objectRotationRow.add( new UI.Text( 'Rotation' ).setWidth( '90px' ) );
 	objectRotationRow.add( objectRotationX, objectRotationY, objectRotationZ );

+ 21 - 5
editor/js/libs/ui.js

@@ -808,18 +808,26 @@ UI.Number.prototype.setValue = function ( value ) {
 
 };
 
-UI.Number.prototype.setRange = function ( min, max ) {
+UI.Number.prototype.setPrecision = function ( precision ) {
 
-	this.min = min;
-	this.max = max;
+	this.precision = precision;
 
 	return this;
 
 };
 
-UI.Number.prototype.setPrecision = function ( precision ) {
+UI.Number.prototype.setStep = function ( step ) {
 
-	this.precision = precision;
+	this.step = step;
+
+	return this;
+
+};
+
+UI.Number.prototype.setRange = function ( min, max ) {
+
+	this.min = min;
+	this.max = max;
 
 	return this;
 
@@ -977,6 +985,14 @@ UI.Integer.prototype.setValue = function ( value ) {
 
 };
 
+UI.Number.prototype.setStep = function ( step ) {
+
+	this.step = step;
+
+	return this;
+
+};
+
 UI.Integer.prototype.setRange = function ( min, max ) {
 
 	this.min = min;