Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 74269d54 authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Bug fixed in slots onSize[XY]Changed() of UIParamBufferSize1D and UIParamBufferSize2D.

parent 4f81573f
......@@ -38,10 +38,15 @@ void UIParamBufferSize1D::onSizeChanged( int size )
if( size == m_Pow2Value )
return;
if( (unsigned int) size < m_Pow2Value )
m_Pow2Value >>= 1;
if( size & (size-1) )
{
if( (unsigned int) size < m_Pow2Value )
m_Pow2Value >>= 1;
else
m_Pow2Value <<= 1;
}
else
m_Pow2Value <<= 1;
m_Pow2Value = size;
QSpinBox *spinSizeX = (QSpinBox*) m_Widget;
spinSizeX->setValue( m_Pow2Value );
......
......@@ -51,20 +51,28 @@ void UIParamBufferSize2D::onSizeXChanged( int size )
if( size == m_Pow2ValueX )
return;
if( (unsigned int) size < m_Pow2ValueX )
if( size & (size-1) )
{
m_Pow2ValueX >>= 1;
m_Pow2ValueY >>= 1;
if( (unsigned int) size < m_Pow2ValueX )
{
m_Pow2ValueX >>= 1;
m_Pow2ValueY >>= 1;
}
else
{
m_Pow2ValueX <<= 1;
m_Pow2ValueY <<= 1;
}
m_SpinSizeX->setValue( m_Pow2ValueX );
m_SpinSizeY->setValue( m_Pow2ValueY );
}
else
{
m_Pow2ValueX <<= 1;
m_Pow2ValueY <<= 1;
m_Pow2ValueX = size;
m_SpinSizeX->setValue( m_Pow2ValueX );
}
m_SpinSizeX->setValue( m_Pow2ValueX );
m_SpinSizeY->setValue( m_Pow2ValueY );
emit valueChanged( QSize(m_Pow2ValueX,m_Pow2ValueY) );
}
......@@ -74,10 +82,15 @@ void UIParamBufferSize2D::onSizeYChanged( int size )
if( size == m_Pow2ValueY )
return;
if( (unsigned int) size < m_Pow2ValueY )
m_Pow2ValueY >>= 1;
if( size & (size-1) )
{
if( (unsigned int) size < m_Pow2ValueY )
m_Pow2ValueY >>= 1;
else
m_Pow2ValueY <<= 1;
}
else
m_Pow2ValueY <<= 1;
m_Pow2ValueY = size;
m_SpinSizeY->setValue( m_Pow2ValueY );
......
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