Changeset 10139 in orxonox.OLD for branches/playability/src/lib/gui/gl/glgui_box.cc
- Timestamp:
- Dec 22, 2006, 12:21:38 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/lib/gui/gl/glgui_box.cc
r9869 r10139 18 18 #include "glgui_box.h" 19 19 #include <cassert> 20 #include <iostream> 20 21 #include "debug.h" 22 #include "network_log.h" 21 23 22 24 namespace OrxGui … … 177 179 void GLGuiBox::resize() 178 180 { 179 if ( orientation() == OrxGui::Vertical)181 if (this->orientation() == OrxGui::Vertical) 180 182 { 181 183 float height = borderTop(); … … 186 188 for (widget = this->_children.begin(); widget != this->_children.end(); ++widget) 187 189 { 188 (*widget)->setRelCoor2D(borderLeft(), height); 189 height += (*widget)->getSizeY2D(); 190 width = fmax(width, (*widget)->getSizeX2D()); 190 float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360; 191 float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir)); 192 float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir)); 193 194 (*widget)->setRelCoor2D(borderLeft(), height + borderTop()); 195 height += realSizeY; 196 width = fmax(width, realSizeX); 191 197 } 192 198 … … 205 211 for (widget = this->_children.begin(); widget != this->_children.end(); ++widget) 206 212 { 213 float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360; 214 //std::cout << "size X: " << (*widget)->getSizeX2D() << "size Y: " << (*widget)->getSizeY2D() << '\n'; 215 float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir)); 216 float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir)); 217 207 218 (*widget)->setRelCoor2D(width, borderTop()); 208 height = fmax(height, (*widget)->getSizeY2D());209 width += (*widget)->getSizeX2D();219 height = fmax(height, realSizeY); 220 width += realSizeX; 210 221 } 211 222
Note: See TracChangeset
for help on using the changeset viewer.