Commit afe5f8d6 authored by Erwan Tulou's avatar Erwan Tulou

skins2: correct forgotten position and set default values

parent cc371f30
......@@ -170,10 +170,12 @@ void* GenericWindow::getOSHandle() const
void GenericWindow::setParent( GenericWindow* pParent, int x, int y, int w, int h )
{
// Update the window size
m_width = w;
m_height = h;
// Update the window size and position
m_left = x;
m_top = y;
m_width = ( w > 0 ) ? w : m_width;
m_height = ( h > 0 ) ? h : m_height;
void* handle = pParent ? pParent->getOSHandle() : NULL;
m_pOsWindow->reparent( handle, x, y, w, h );
m_pOsWindow->reparent( handle, m_left, m_top, m_width, m_height );
}
......@@ -96,7 +96,8 @@ public:
void* getOSHandle() const;
/// reparent
void setParent( GenericWindow* pParent, int x, int y, int w, int h );
void setParent( GenericWindow* pParent,
int x = 0, int y = 0, int w = -1, int h = -1 );
protected:
/// Get the OS window
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment