Procházet zdrojové kódy

Editor: fixed scene export being broken on initial page load.

That was a bit tricky - because Viewport was created before Sidebar.Outliner, cameraChanged signal wasn't effectively setting activeCamera in Outliner (which is how it is passed to SceneExporter).

Changing order of these UI element creations though started to (correctly) highlight Viewport, and as this is controlled via pseudo CSS :focus class, it can't be easily overridden from JavaScript. We should really start to use CSS.
alteredq před 13 roky
rodič
revize
fe902e553f
2 změnil soubory, kde provedl 14 přidání a 10 odebrání
  1. 12 10
      editor/index.html
  2. 2 0
      editor/js/ui/Viewport.js

+ 12 - 10
editor/index.html

@@ -15,6 +15,7 @@
 				border-top: 1px solid #ccc;
 			}
 
+			.hideFocus:focus { outline: 0 }
 		</style>
 	</head>
 	<body>
@@ -82,6 +83,17 @@
 
 			//
 
+			var menubar = new Menubar( signals );
+			menubar.setWidth( '100%' );
+			menubar.setHeight( '32px' );
+			document.body.appendChild( menubar.dom );
+
+			var sidebar = new Sidebar( signals );
+			sidebar.setLeft( '-webkit-calc(100% - 300px)', '-moz-calc(100% - 300px)', 'calc(100% - 300px)' );
+			sidebar.setTop( '32px' );
+			sidebar.setHeight( '-webkit-calc(100% - 32px)', '-moz-calc(100% - 32px)', 'calc(100% - 32px)' );
+			document.body.appendChild( sidebar.dom );
+
 			var viewport = new Viewport( signals );
 			viewport.setTop( '32px' );
 			viewport.setWidth( '-webkit-calc(100% - 300px)', '-moz-calc(100% - 300px)', 'calc(100% - 300px)' );
@@ -93,16 +105,6 @@
 
 			viewport.dom.focus();
 
-			var menubar = new Menubar( signals );
-			menubar.setWidth( '100%' );
-			menubar.setHeight( '32px' );
-			document.body.appendChild( menubar.dom );
-
-			var sidebar = new Sidebar( signals );
-			sidebar.setLeft( '-webkit-calc(100% - 300px)', '-moz-calc(100% - 300px)', 'calc(100% - 300px)' );
-			sidebar.setTop( '32px' );
-			sidebar.setHeight( '-webkit-calc(100% - 32px)', '-moz-calc(100% - 32px)', 'calc(100% - 32px)' );
-			document.body.appendChild( sidebar.dom );
 
 			document.addEventListener( 'drop', function ( event ) {
 

+ 2 - 0
editor/js/ui/Viewport.js

@@ -499,6 +499,8 @@ var Viewport = function ( signals ) {
 	container.dom.tabIndex = 1;
 	container.dom.addEventListener( 'keydown', onKeyDown, false );
 
+	container.dom.className = "hideFocus";
+
 	//
 
 	function updateMaterials( root ) {