Changeset 10368 in orxonox.OLD for trunk/src/lib/gui
- Timestamp:
- Jan 25, 2007, 2:18:07 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 10 10 autom4te.cache 11 11 aclocal.m4 12 tags 13 test.bmp 14 config.sub 15 config.guess 16 OrxonoxPlayability.kdevses 17 OrxonoxPlayability.kdevelop.pcs
-
- Property svn:ignore
-
trunk/src/lib/gui/gl/glgui_bar.cc
r9869 r10368 71 71 72 72 this->_value = value; 73 this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum)/ (_minimum + _maximum)73 this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum) 74 74 ,this->getSizeY2D() - borderTop() - borderBottom()); 75 75 } … … 99 99 100 100 this->_frontRect.setTopLeft(borderLeft(), borderTop()); 101 this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum)/ (_minimum + _maximum)102 101 this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum) 102 ,this->getSizeY2D() - borderTop() - borderBottom()); 103 103 104 104 } -
trunk/src/lib/gui/gl/glgui_box.cc
r9869 r10368 18 18 #include "glgui_box.h" 19 19 #include <cassert> 20 #include <iostream> 20 21 #include "debug.h" 22 #include "network_log.h" 23 21 24 22 25 namespace OrxGui … … 177 180 void GLGuiBox::resize() 178 181 { 179 if ( orientation() == OrxGui::Vertical)182 if (this->orientation() == OrxGui::Vertical) 180 183 { 181 184 float height = borderTop(); … … 186 189 for (widget = this->_children.begin(); widget != this->_children.end(); ++widget) 187 190 { 188 (*widget)->setRelCoor2D(borderLeft(), height); 189 height += (*widget)->getSizeY2D(); 190 width = fmax(width, (*widget)->getSizeX2D()); 191 //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360; 192 //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir)); 193 //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir)); 194 float realSizeX, realSizeY; 195 int angleAbs = (int)(*widget)->getAbsDir2D(); 196 int angleRel = (int)(*widget)->getRelDir2D(); 197 //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n'; 198 if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180) 199 { 200 realSizeX = (*widget)->getSizeX2D(); 201 realSizeY = (*widget)->getSizeY2D(); 202 //std::cout<<"box vertical, widget 0or180"; 203 } 204 else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270) 205 { 206 realSizeX = (*widget)->getSizeY2D(); 207 realSizeY = (*widget)->getSizeX2D(); 208 //std::cout<<"box vertical, widget 90or270"; 209 } 210 211 (*widget)->setRelCoor2D(borderLeft(), height + borderTop()); 212 height += realSizeY; 213 width = fmax(width, realSizeX); 191 214 } 192 215 … … 205 228 for (widget = this->_children.begin(); widget != this->_children.end(); ++widget) 206 229 { 230 //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360; 231 //std::cout << "size X: " << (*widget)->getSizeX2D() << "size Y: " << (*widget)->getSizeY2D() << '\n'; 232 //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir)); 233 //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir)); 234 float realSizeX, realSizeY; 235 int angleAbs = (int)(*widget)->getAbsDir2D(); 236 int angleRel = (int)(*widget)->getRelDir2D(); 237 //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n'; 238 if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180) 239 { 240 realSizeX = (*widget)->getSizeX2D(); 241 realSizeY = (*widget)->getSizeY2D(); 242 //std::cout<<"box horicontal, widget 0or180"; 243 } 244 else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270) 245 { 246 realSizeX = (*widget)->getSizeY2D(); 247 realSizeY = (*widget)->getSizeX2D(); 248 //std::cout<<"box horicontal, widget 90or270"; 249 } 250 207 251 (*widget)->setRelCoor2D(width, borderTop()); 208 height = fmax(height, (*widget)->getSizeY2D());209 width += (*widget)->getSizeX2D();252 height = fmax(height, realSizeY); 253 width += realSizeX; 210 254 } 211 255 -
trunk/src/lib/gui/gl/glgui_widget.cc
r10317 r10368 915 915 } 916 916 917 void GLGuiWidget::beginDraw() const 918 { 919 glPushMatrix(); 920 glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); 921 glRotatef(this->getAbsDir2D(), 0, 0, 1); 922 } 923 917 924 918 925 } -
trunk/src/lib/gui/gl/glgui_widget.h
r9869 r10368 244 244 245 245 /// RENDERING 246 inline void beginDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };246 void beginDraw() const; 247 247 inline void endDraw() const { glPopMatrix(); }; 248 248
Note: See TracChangeset
for help on using the changeset viewer.