Browse Source

Dropping a window inside dock area but outside of dock borders now properly restores the floating window instead of just closing it

Marko Pintera 10 years ago
parent
commit
9c86db0da9
2 changed files with 17 additions and 7 deletions
  1. 17 6
      BansheeEditor/Source/BsDockManager.cpp
  2. 0 1
      TODO.txt

+ 17 - 6
BansheeEditor/Source/BsDockManager.cpp

@@ -1002,21 +1002,32 @@ namespace BansheeEngine
 				if(overlayBounds.contains(windowPos))
 				{
 					insert(nullptr, draggedWidget, DockLocation::None);
+					return true;
 				}
 			}
 			else
 			{
-				if(insidePolygon(mTopDropPolygon, 4, windowPosVec))
+				if (insidePolygon(mTopDropPolygon, 4, windowPosVec))
+				{
 					insert(mouseOverContainer->mWidgets, draggedWidget, DockLocation::Top);
-				else if(insidePolygon(mBotDropPolygon, 4, windowPosVec))
+					return true;
+				}
+				else if (insidePolygon(mBotDropPolygon, 4, windowPosVec))
+				{
 					insert(mouseOverContainer->mWidgets, draggedWidget, DockLocation::Bottom);
-				else if(insidePolygon(mLeftDropPolygon, 4, windowPosVec))
+					return true;
+				}
+				else if (insidePolygon(mLeftDropPolygon, 4, windowPosVec))
+				{
 					insert(mouseOverContainer->mWidgets, draggedWidget, DockLocation::Left);
-				else if(insidePolygon(mRightDropPolygon, 4, windowPosVec))
+					return true;
+				}
+				else if (insidePolygon(mRightDropPolygon, 4, windowPosVec))
+				{
 					insert(mouseOverContainer->mWidgets, draggedWidget, DockLocation::Right);
+					return true;
+				}
 			}
-
-			return true;
 		}
 
 		return false;

+ 0 - 1
TODO.txt

@@ -67,7 +67,6 @@ Click on empty part of the menu bar doesn't close the menu bar (ignoring NC area
 Clicking on a parent of a menu item just reopens that item but I would expect it to close it
 Clicking on menu items doesn't seem to work
 Attempting to dock a window that is not in focus will start drag instead (NC area incorrectly set up?)
-Removing the last widget from the dock area will cause a crash
 Dropping an element in "None" dock area closes the window
 Decent looking default layout
 Fix DX11 (and possibly DX9) rendering