Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2006, 12:21:38 AM (18 years ago)
Author:
muellmic
Message:

trying to adjust interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/lib/gui/gl/glgui_box.cc

    r9869 r10139  
    1818#include "glgui_box.h"
    1919#include <cassert>
     20#include <iostream>
    2021#include "debug.h"
     22#include "network_log.h"
    2123
    2224namespace OrxGui
     
    177179  void GLGuiBox::resize()
    178180  {
    179     if (orientation() == OrxGui::Vertical)
     181    if (this->orientation() == OrxGui::Vertical)
    180182    {
    181183      float height = borderTop();
     
    186188      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
    187189      {
    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);
    191197      }
    192198
     
    205211      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
    206212      {
     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
    207218        (*widget)->setRelCoor2D(width, borderTop());
    208         height = fmax(height, (*widget)->getSizeY2D());
    209         width += (*widget)->getSizeX2D();
     219        height = fmax(height, realSizeY);
     220        width += realSizeX;
    210221      }
    211222
Note: See TracChangeset for help on using the changeset viewer.