소스 검색

Fixed GUI layout so it doesn't incorrectly set its minimum size range based on its children, therefore potentially expanding other children out of bounds
Scene viewport is now the correct size (same as the render texture it shows)

Marko Pintera 10 년 전
부모
커밋
104413fc4a
5개의 변경된 파일27개의 추가작업 그리고 15개의 파일을 삭제
  1. 2 2
      BansheeEditor/Source/BsSceneGrid.cpp
  2. 1 1
      BansheeEditorExec/BsEditorExec.cpp
  3. 8 6
      BansheeEngine/Source/BsGUILayoutX.cpp
  4. 8 6
      BansheeEngine/Source/BsGUILayoutY.cpp
  5. 8 0
      TODO.txt

+ 2 - 2
BansheeEditor/Source/BsSceneGrid.cpp

@@ -12,9 +12,9 @@
 
 namespace BansheeEngine
 {
-	const Color SceneGrid::GRID_LINE_COLOR = Color(1.0f, 1.0f, 1.0f);
+	const Color SceneGrid::GRID_LINE_COLOR = Color(0.5f, 0.5f, 0.5f);
 	const float SceneGrid::LINE_WIDTH = 0.025f;
-	const float SceneGrid::LINE_BORDER_WIDTH = 0.0075f;
+	const float SceneGrid::LINE_BORDER_WIDTH = 0.00075f;
 	const float SceneGrid::MAJOR_AXIS_WIDTH = 0.075f;
 	const float SceneGrid::MAJOR_AXIS_BORDER_WIDTH = 0.015f;
 	const float SceneGrid::AXIS_MARKER_WIDTH = 0.1f;

+ 1 - 1
BansheeEditorExec/BsEditorExec.cpp

@@ -65,7 +65,7 @@ int CALLBACK WinMain(
 	InitializeDebugConsole();
 #endif
 
-	EditorApplication::startUp(RenderSystemPlugin::OpenGL);
+	EditorApplication::startUp(RenderSystemPlugin::DX11);
 	EditorApplication::instance().runMainLoop();
 	EditorApplication::shutDown();
 

+ 8 - 6
BansheeEngine/Source/BsGUILayoutX.cpp

@@ -28,12 +28,13 @@ namespace BansheeEngine
 			UINT32 paddingY = child->_getPadding().top + child->_getPadding().bottom;
 
 			layoutSizeRange.optimal.x += sizeRange.optimal.x + paddingX;
-			layoutSizeRange.min.x += sizeRange.min.x + paddingX;
-
 			layoutSizeRange.optimal.y = std::max((UINT32)layoutSizeRange.optimal.y, sizeRange.optimal.y + paddingY);
-			layoutSizeRange.min.y = std::max((UINT32)layoutSizeRange.min.y, sizeRange.min.y + paddingY);
 		}
 
+		// Layout has no min or max, it respects the bounds of its parent element and
+		// child elements
+		layoutSizeRange.min.x = 0;
+		layoutSizeRange.min.y = 0;
 		layoutSizeRange.max.x = 0;
 		layoutSizeRange.max.y = 0;
 
@@ -81,14 +82,15 @@ namespace BansheeEngine
 			UINT32 paddingY = child->_getPadding().top + child->_getPadding().bottom;
 
 			mSizeRange.optimal.x += childSizeRange.optimal.x + paddingX;
-			mSizeRange.min.x += childSizeRange.min.x + paddingX;
-
 			mSizeRange.optimal.y = std::max((UINT32)mSizeRange.optimal.y, childSizeRange.optimal.y + paddingY);
-			mSizeRange.min.y = std::max((UINT32)mSizeRange.min.y, childSizeRange.min.y + paddingY);
 
 			childIdx++;
 		}
 
+		// Layout has no min or max, it respects the bounds of its parent element and
+		// child elements
+		mSizeRange.min.x = 0;
+		mSizeRange.min.y = 0;
 		mSizeRange.max.x = 0;
 		mSizeRange.max.y = 0;
 	}

+ 8 - 6
BansheeEngine/Source/BsGUILayoutY.cpp

@@ -28,12 +28,13 @@ namespace BansheeEngine
 			UINT32 paddingY = child->_getPadding().top + child->_getPadding().bottom;
 
 			layoutSizeRange.optimal.y += sizeRange.optimal.y + paddingY;
-			layoutSizeRange.min.y += sizeRange.min.y + paddingY;
-
 			layoutSizeRange.optimal.x = std::max((UINT32)layoutSizeRange.optimal.x, sizeRange.optimal.x + paddingX);
-			layoutSizeRange.min.x = std::max((UINT32)layoutSizeRange.min.x, sizeRange.min.x + paddingX);
 		}
 
+		// Layout has no min or max, it respects the bounds of its parent element and
+		// child elements
+		layoutSizeRange.min.x = 0;
+		layoutSizeRange.min.y = 0;
 		layoutSizeRange.max.x = 0;
 		layoutSizeRange.max.y = 0;
 
@@ -81,14 +82,15 @@ namespace BansheeEngine
 			UINT32 paddingY = child->_getPadding().top + child->_getPadding().bottom;
 
 			mSizeRange.optimal.y += childSizeRange.optimal.y + paddingY;
-			mSizeRange.min.y += childSizeRange.min.y + paddingY;
-
 			mSizeRange.optimal.x = std::max((UINT32)mSizeRange.optimal.x, childSizeRange.optimal.x + paddingX);
-			mSizeRange.min.x = std::max((UINT32)mSizeRange.min.x, childSizeRange.min.x + paddingX);
 
 			childIdx++;
 		}
 
+		// Layout has no min or max, it respects the bounds of its parent element and
+		// child elements
+		mSizeRange.min.x = 0;
+		mSizeRange.min.y = 0;
 		mSizeRange.max.x = 0;
 		mSizeRange.max.y = 0;
 	}

+ 8 - 0
TODO.txt

@@ -76,6 +76,14 @@ Other simple stuff:
  - GUI TextureField similar to ResourceField but it displays the texture it has assigned
  - Getting rid of import on start would be a pretty big deal. Just adding a button in Editor "Reimport" should be good instead
 
+Minor issues:
+ - When opening up Color picker it is screwed up for a frame or two
+ - When selecting a mesh, handle shows up first, and only then the selection render
+ - When initially loading the program mesh texture is screwed up for a frame or two (OpenGL - garbage, DX9 - black, DX11 - seems okay)
+ - Attemping to select a mesh while another window is focused doesn't work. Only after first click focuses the window will it work after user clicks again. (OpenGL only?)
+ - Grid depth is wrong
+ - Grid jaggies seem worse than on my test grid
+
 ----------------------------------------------------------------------
 Handles