浏览代码

Editor: Clean up.

Mr.doob 1 年之前
父节点
当前提交
7847e6b476
共有 4 个文件被更改,包括 11 次插入11 次删除
  1. 3 3
      editor/js/Sidebar.Geometry.js
  2. 3 3
      editor/js/Sidebar.Material.js
  3. 3 3
      editor/js/Sidebar.Object.js
  4. 2 2
      editor/js/Sidebar.Project.Video.js

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

@@ -192,11 +192,11 @@ function SidebarGeometry( editor ) {
 
 
 		}
 		}
 
 
-		const left = ( screen.width / 2 ) - ( 250 );
-		const top = ( screen.height / 2 ) - ( 250 );
+		const left = ( screen.width - 500 ) / 2;
+		const top = ( screen.height - 500 ) / 2;
 
 
 		const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain' } ) );
 		const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain' } ) );
-		window.open( url, null, `location=no,left=${left},top=${top},width=500,height=500` );
+		window.open( url, '_blank', `location=no,left=${left},top=${top},width=500,height=500` );
 
 
 	} );
 	} );
 	container.add( exportJson );
 	container.add( exportJson );

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

@@ -435,11 +435,11 @@ function SidebarMaterial( editor ) {
 
 
 		}
 		}
 
 
-		const left = ( screen.width / 2 ) - ( 250 );
-		const top = ( screen.height / 2 ) - ( 250 );
+		const left = ( screen.width - 500 ) / 2;
+		const top = ( screen.height - 500 ) / 2;
 
 
 		const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain' } ) );
 		const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain' } ) );
-		window.open( url, null, `location=no,left=${left},top=${top},width=500,height=500` );
+		window.open( url, '_blank', `location=no,left=${left},top=${top},width=500,height=500` );
 
 
 	} );
 	} );
 	container.add( exportJson );
 	container.add( exportJson );

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

@@ -407,11 +407,11 @@ function SidebarObject( editor ) {
 
 
 		}
 		}
 
 
-		const left = ( screen.width / 2 ) - ( 250 );
-		const top = ( screen.height / 2 ) - ( 250 );
+		const left = ( screen.width - 500 ) / 2;
+		const top = ( screen.height - 500 ) / 2;
 
 
 		const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain' } ) );
 		const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain' } ) );
-		window.open( url, null, `location=no,left=${left},top=${top},width=500,height=500` );
+		window.open( url, '_blank', `location=no,left=${left},top=${top},width=500,height=500` );
 
 
 	} );
 	} );
 	container.add( exportJson );
 	container.add( exportJson );

+ 2 - 2
editor/js/Sidebar.Project.Video.js

@@ -65,8 +65,8 @@ function SidebarProjectVideo( editor ) {
 		canvas.style.width = width + 'px';
 		canvas.style.width = width + 'px';
 		canvas.style.height = height + 'px';
 		canvas.style.height = height + 'px';
 
 
-		const left = ( screen.width / 2 ) - ( width / 2 );
-		const top = ( screen.height / 2 ) - ( height / 2 );
+		const left = ( screen.width - width ) / 2;
+		const top = ( screen.height - height ) / 2;
 
 
 		const output = window.open( '', '_blank', `location=no,left=${left},top=${top},width=${width},height=${height}` );
 		const output = window.open( '', '_blank', `location=no,left=${left},top=${top},width=${width},height=${height}` );
 		output.document.body.style.background = '#000';
 		output.document.body.style.background = '#000';