Explorar el Código

Editor: Removed export precision setting (#22002)

Mr.doob hace 4 años
padre
commit
c53e323d5e
Se han modificado 4 ficheros con 4 adiciones y 36 borrados
  1. 0 1
      editor/js/Config.js
  2. 4 14
      editor/js/Menubar.File.js
  3. 0 18
      editor/js/Sidebar.Settings.js
  4. 0 3
      editor/js/Strings.js

+ 0 - 1
editor/js/Config.js

@@ -4,7 +4,6 @@ function Config() {
 
 	var storage = {
 		'language': 'en',
-		'exportPrecision': 6,
 
 		'autosave': true,
 

+ 4 - 14
editor/js/Menubar.File.js

@@ -6,16 +6,6 @@ import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
 
 function MenubarFile( editor ) {
 
-	function parseNumber( key, value ) {
-
-		var precision = config.getKey( 'exportPrecision' );
-
-		return typeof value === 'number' ? parseFloat( value.toFixed( precision ) ) : value;
-
-	}
-
-	//
-
 	var config = editor.config;
 	var strings = editor.strings;
 
@@ -111,7 +101,7 @@ function MenubarFile( editor ) {
 
 		try {
 
-			output = JSON.stringify( output, parseNumber, '\t' );
+			output = JSON.stringify( output, null, '\t' );
 			output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
 
 		} catch ( e ) {
@@ -145,7 +135,7 @@ function MenubarFile( editor ) {
 
 		try {
 
-			output = JSON.stringify( output, parseNumber, '\t' );
+			output = JSON.stringify( output, null, '\t' );
 			output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
 
 		} catch ( e ) {
@@ -170,7 +160,7 @@ function MenubarFile( editor ) {
 
 		try {
 
-			output = JSON.stringify( output, parseNumber, '\t' );
+			output = JSON.stringify( output, null, '\t' );
 			output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
 
 		} catch ( e ) {
@@ -424,7 +414,7 @@ function MenubarFile( editor ) {
 		output.metadata.type = 'App';
 		delete output.history;
 
-		output = JSON.stringify( output, parseNumber, '\t' );
+		output = JSON.stringify( output, null, '\t' );
 		output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
 
 		toZip[ 'app.json' ] = strToU8( output );

+ 0 - 18
editor/js/Sidebar.Settings.js

@@ -47,24 +47,6 @@ function SidebarSettings( editor ) {
 
 	settings.add( languageRow );
 
-	// export precision
-
-	var exportPrecisionRow = new UIRow();
-	var exportPrecision = new UIInteger( config.getKey( 'exportPrecision' ) ).setRange( 2, Infinity );
-
-	exportPrecision.onChange( function () {
-
-		var value = this.getValue();
-
-		editor.config.setKey( 'exportPrecision', value );
-
-	} );
-
-	exportPrecisionRow.add( new UIText( strings.getKey( 'sidebar/settings/exportPrecision' ) ).setWidth( '90px' ) );
-	exportPrecisionRow.add( exportPrecision );
-
-	settings.add( exportPrecisionRow );
-
 	//
 
 	container.add( new SidebarSettingsViewport( editor ) );

+ 0 - 3
editor/js/Strings.js

@@ -311,7 +311,6 @@ function Strings( config ) {
 
 			'sidebar/settings': 'Settings',
 			'sidebar/settings/language': 'Language',
-			'sidebar/settings/exportPrecision': 'Export Precision',
 
 			'sidebar/settings/shortcuts': 'Shortcuts',
 			'sidebar/settings/shortcuts/translate': 'Translate',
@@ -646,7 +645,6 @@ function Strings( config ) {
 
 			'sidebar/settings': 'Paramètres',
 			'sidebar/settings/language': 'Langue',
-			'sidebar/settings/exportPrecision': 'Précision à l\'exportation',
 
 			'sidebar/settings/shortcuts': 'Shortcuts',
 			'sidebar/settings/shortcuts/translate': 'Position',
@@ -981,7 +979,6 @@ function Strings( config ) {
 
 			'sidebar/settings': '设置',
 			'sidebar/settings/language': '语言',
-			'sidebar/settings/exportPrecision': '输出精度',
 
 			'sidebar/settings/shortcuts': '快捷键',
 			'sidebar/settings/shortcuts/translate': '移动',