소스 검색

Fixed a bug in Toolbar that placed child components incorrectly.

David Piuva 2 년 전
부모
커밋
540348c7c9
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      Source/DFPSR/gui/components/Toolbar.cpp

+ 2 - 2
Source/DFPSR/gui/components/Toolbar.cpp

@@ -118,7 +118,7 @@ void Toolbar::updateLocationEvent(const IRect& oldLocation, const IRect& newLoca
 		// Place each child component in order.
 		// Place each child component in order.
 		//   Each child is created within a segmented region, but can choose to add more padding or limit its height for fine adjustments.
 		//   Each child is created within a segmented region, but can choose to add more padding or limit its height for fine adjustments.
 		int left = this->padding.value;
 		int left = this->padding.value;
-		int top = newLocation.top() + this->padding.value;
+		int top = this->padding.value;
 		int width = newLocation.width() - (this->padding.value * 2);
 		int width = newLocation.width() - (this->padding.value * 2);
 		for (int i = 0; i < this->getChildCount(); i++) {
 		for (int i = 0; i < this->getChildCount(); i++) {
 			int height = this->children[i]->getDesiredDimensions().y;
 			int height = this->children[i]->getDesiredDimensions().y;
@@ -129,7 +129,7 @@ void Toolbar::updateLocationEvent(const IRect& oldLocation, const IRect& newLoca
 		// TODO: Add scroll buttons on the sides if there is not enough space for all child components.
 		// TODO: Add scroll buttons on the sides if there is not enough space for all child components.
 		// Place each child component in order.
 		// Place each child component in order.
 		//   Each child is created within a segmented region, but can choose to add more padding or limit its height for fine adjustments.
 		//   Each child is created within a segmented region, but can choose to add more padding or limit its height for fine adjustments.
-		int left = newLocation.left() + this->padding.value;
+		int left = this->padding.value;
 		int top = this->padding.value;
 		int top = this->padding.value;
 		int height = newLocation.height() - (this->padding.value * 2);
 		int height = newLocation.height() - (this->padding.value * 2);
 		for (int i = 0; i < this->getChildCount(); i++) {
 		for (int i = 0; i < this->getChildCount(); i++) {