未验证 提交 c53e323d 编写于 作者: M Mr.doob 提交者: GitHub

Editor: Removed export precision setting (#22002)

上级 382190a7
...@@ -4,7 +4,6 @@ function Config() { ...@@ -4,7 +4,6 @@ function Config() {
var storage = { var storage = {
'language': 'en', 'language': 'en',
'exportPrecision': 6,
'autosave': true, 'autosave': true,
......
...@@ -6,16 +6,6 @@ import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js'; ...@@ -6,16 +6,6 @@ import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
function MenubarFile( editor ) { 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 config = editor.config;
var strings = editor.strings; var strings = editor.strings;
...@@ -111,7 +101,7 @@ function MenubarFile( editor ) { ...@@ -111,7 +101,7 @@ function MenubarFile( editor ) {
try { try {
output = JSON.stringify( output, parseNumber, '\t' ); output = JSON.stringify( output, null, '\t' );
output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' ); output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
} catch ( e ) { } catch ( e ) {
...@@ -145,7 +135,7 @@ function MenubarFile( editor ) { ...@@ -145,7 +135,7 @@ function MenubarFile( editor ) {
try { try {
output = JSON.stringify( output, parseNumber, '\t' ); output = JSON.stringify( output, null, '\t' );
output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' ); output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
} catch ( e ) { } catch ( e ) {
...@@ -170,7 +160,7 @@ function MenubarFile( editor ) { ...@@ -170,7 +160,7 @@ function MenubarFile( editor ) {
try { try {
output = JSON.stringify( output, parseNumber, '\t' ); output = JSON.stringify( output, null, '\t' );
output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' ); output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
} catch ( e ) { } catch ( e ) {
...@@ -424,7 +414,7 @@ function MenubarFile( editor ) { ...@@ -424,7 +414,7 @@ function MenubarFile( editor ) {
output.metadata.type = 'App'; output.metadata.type = 'App';
delete output.history; delete output.history;
output = JSON.stringify( output, parseNumber, '\t' ); output = JSON.stringify( output, null, '\t' );
output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' ); output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
toZip[ 'app.json' ] = strToU8( output ); toZip[ 'app.json' ] = strToU8( output );
......
...@@ -47,24 +47,6 @@ function SidebarSettings( editor ) { ...@@ -47,24 +47,6 @@ function SidebarSettings( editor ) {
settings.add( languageRow ); 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 ) ); container.add( new SidebarSettingsViewport( editor ) );
......
...@@ -311,7 +311,6 @@ function Strings( config ) { ...@@ -311,7 +311,6 @@ function Strings( config ) {
'sidebar/settings': 'Settings', 'sidebar/settings': 'Settings',
'sidebar/settings/language': 'Language', 'sidebar/settings/language': 'Language',
'sidebar/settings/exportPrecision': 'Export Precision',
'sidebar/settings/shortcuts': 'Shortcuts', 'sidebar/settings/shortcuts': 'Shortcuts',
'sidebar/settings/shortcuts/translate': 'Translate', 'sidebar/settings/shortcuts/translate': 'Translate',
...@@ -646,7 +645,6 @@ function Strings( config ) { ...@@ -646,7 +645,6 @@ function Strings( config ) {
'sidebar/settings': 'Paramètres', 'sidebar/settings': 'Paramètres',
'sidebar/settings/language': 'Langue', 'sidebar/settings/language': 'Langue',
'sidebar/settings/exportPrecision': 'Précision à l\'exportation',
'sidebar/settings/shortcuts': 'Shortcuts', 'sidebar/settings/shortcuts': 'Shortcuts',
'sidebar/settings/shortcuts/translate': 'Position', 'sidebar/settings/shortcuts/translate': 'Position',
...@@ -981,7 +979,6 @@ function Strings( config ) { ...@@ -981,7 +979,6 @@ function Strings( config ) {
'sidebar/settings': '设置', 'sidebar/settings': '设置',
'sidebar/settings/language': '语言', 'sidebar/settings/language': '语言',
'sidebar/settings/exportPrecision': '输出精度',
'sidebar/settings/shortcuts': '快捷键', 'sidebar/settings/shortcuts': '快捷键',
'sidebar/settings/shortcuts/translate': '移动', 'sidebar/settings/shortcuts/translate': '移动',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册