From: Olivier Teulière Date: Sun, 4 Dec 2005 18:23:30 +0000 (+0000) Subject: * skins2/src/generic_layout.cpp: Fixed a resizing bug (the invisible controls X-Git-Tag: 0.9.0-test0~13071 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1e26b23a83bf39e53884b56d984ccdc6e0da2d63;p=vlc * skins2/src/generic_layout.cpp: Fixed a resizing bug (the invisible controls were drawn when resizing the layout) --- diff --git a/modules/gui/skins2/src/generic_layout.cpp b/modules/gui/skins2/src/generic_layout.cpp index 0752237900..37077e6c86 100644 --- a/modules/gui/skins2/src/generic_layout.cpp +++ b/modules/gui/skins2/src/generic_layout.cpp @@ -144,11 +144,6 @@ void GenericLayout::onControlUpdate( const CtrlGeneric &rCtrl, void GenericLayout::resize( int width, int height ) { - if( width == m_width && height == m_height ) - { - return; - } - // Check boundaries if( width < m_minWidth ) { @@ -167,6 +162,11 @@ void GenericLayout::resize( int width, int height ) height = m_maxHeight; } + if( width == m_width && height == m_height ) + { + return; + } + // Update the window size m_width = width; m_height = height; @@ -183,12 +183,12 @@ void GenericLayout::resize( int width, int height ) list::const_iterator iter; for( iter = m_controlList.begin(); iter != m_controlList.end(); iter++ ) { - (*iter).m_pControl->onResize(); - const Position *pPos = (*iter).m_pControl->getPosition(); - if( pPos ) + iter->m_pControl->onResize(); + const Position *pPos = iter->m_pControl->getPosition(); + if( pPos && iter->m_pControl->isVisible() ) { - (*iter).m_pControl->draw( *m_pImage, pPos->getLeft(), - pPos->getTop() ); + iter->m_pControl->draw( *m_pImage, pPos->getLeft(), + pPos->getTop() ); } } @@ -223,7 +223,7 @@ void GenericLayout::refreshRect( int x, int y, int width, int height ) { CtrlGeneric *pCtrl = (*iter).m_pControl; const Position *pPos = pCtrl->getPosition(); - if( pCtrl->isVisible() && pPos ) + if( pPos && pCtrl->isVisible() ) { pCtrl->draw( *m_pImage, pPos->getLeft(), pPos->getTop() ); // Remember the video control (we assume there is at most one video