Selaa lähdekoodia

Fixed an issue where negative offset determined by the layout would place the element outside of scroll area

Marko Pintera 12 vuotta sitten
vanhempi
sitoutus
58dd304790
3 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 1 0
      BansheeEngine/Source/BsGUILayoutX.cpp
  2. 1 0
      BansheeEngine/Source/BsGUILayoutY.cpp
  3. 1 0
      TODO.txt

+ 1 - 0
BansheeEngine/Source/BsGUILayoutX.cpp

@@ -354,6 +354,7 @@ namespace BansheeEngine
 				element->_setHeight(elemHeight);
 
 				INT32 yOffset = Math::CeilToInt(((INT32)height - (INT32)element->_getHeight()) * 0.5f);
+				yOffset = std::max(0, yOffset);
 
 				Int2 offset(x + xOffset, y + yOffset);
 				element->_setOffset(offset);

+ 1 - 0
BansheeEngine/Source/BsGUILayoutY.cpp

@@ -354,6 +354,7 @@ namespace BansheeEngine
 				element->_setHeight(elemHeight);
 
 				INT32 xOffset = Math::CeilToInt((INT32)(width - (INT32)element->_getWidth()) * 0.5f);
+				xOffset = std::max(0, xOffset);
 
 				Int2 offset(x + xOffset, y + yOffset);
 				element->_setOffset(offset);

+ 1 - 0
TODO.txt

@@ -39,6 +39,7 @@ IMMEDIATE:
 - InputBox text clip rect is probably wrong as it doesn't account parent element clip rect
  (possibly selection and caret clip rects too)
 - Hover colors of the scroll bar are wrong
+- Ability to scroll by just mousing over and moving the scroll wheel
 
 TextBox needed elements:
  - Key-repeat? Pressing left/right/up/down arrows doesn't repeat the keys (also delete/backspace)