Skip to content

Commit 8bf4a9e

Browse files
committed
Editor: Faster rotation.
1 parent 6a2e7a0 commit 8bf4a9e

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

editor/js/Sidebar.Object.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ Sidebar.Object = function ( editor ) {
109109
// rotation
110110

111111
var objectRotationRow = new UI.Row();
112-
var objectRotationX = new UI.Number().setUnit( '°' ).setWidth( '50px' ).onChange( update );
113-
var objectRotationY = new UI.Number().setUnit( '°' ).setWidth( '50px' ).onChange( update );
114-
var objectRotationZ = new UI.Number().setUnit( '°' ).setWidth( '50px' ).onChange( update );
112+
var objectRotationX = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
113+
var objectRotationY = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
114+
var objectRotationZ = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
115115

116116
objectRotationRow.add( new UI.Text( 'Rotation' ).setWidth( '90px' ) );
117117
objectRotationRow.add( objectRotationX, objectRotationY, objectRotationZ );

editor/js/libs/ui.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -808,18 +808,26 @@ UI.Number.prototype.setValue = function ( value ) {
808808

809809
};
810810

811-
UI.Number.prototype.setRange = function ( min, max ) {
811+
UI.Number.prototype.setPrecision = function ( precision ) {
812812

813-
this.min = min;
814-
this.max = max;
813+
this.precision = precision;
815814

816815
return this;
817816

818817
};
819818

820-
UI.Number.prototype.setPrecision = function ( precision ) {
819+
UI.Number.prototype.setStep = function ( step ) {
821820

822-
this.precision = precision;
821+
this.step = step;
822+
823+
return this;
824+
825+
};
826+
827+
UI.Number.prototype.setRange = function ( min, max ) {
828+
829+
this.min = min;
830+
this.max = max;
823831

824832
return this;
825833

@@ -977,6 +985,14 @@ UI.Integer.prototype.setValue = function ( value ) {
977985

978986
};
979987

988+
UI.Number.prototype.setStep = function ( step ) {
989+
990+
this.step = step;
991+
992+
return this;
993+
994+
};
995+
980996
UI.Integer.prototype.setRange = function ( min, max ) {
981997

982998
this.min = min;

0 commit comments

Comments
 (0)