Commit 4382ab9c authored by Erwan Tulou's avatar Erwan Tulou

skins2: optimize the refresh of slider control

only refresh position if the value really changed w.r.t the control measure unit.
parent 63b8b9fe
...@@ -436,7 +436,11 @@ void CtrlSliderBg::associateCursor( CtrlSliderCursor &rCursor ) ...@@ -436,7 +436,11 @@ void CtrlSliderBg::associateCursor( CtrlSliderCursor &rCursor )
void CtrlSliderBg::onUpdate( Subject<VarPercent> &rVariable, void*arg ) void CtrlSliderBg::onUpdate( Subject<VarPercent> &rVariable, void*arg )
{ {
m_position = (int)( m_rVariable.get() * (m_nbHoriz * m_nbVert - 1) ); int position = (int)( m_rVariable.get() * (m_nbHoriz * m_nbVert - 1) );
if( position == m_position )
return;
m_position = position;
notifyLayout( m_bgWidth, m_bgHeight ); notifyLayout( m_bgWidth, m_bgHeight );
} }
......
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