Commit b4882997 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Prevent PreviewRuler (sliders) to go out of bounds

parent abfa70a8
......@@ -203,7 +203,11 @@ void PreviewRuler::mouseMoveEvent( QMouseEvent* event )
if ( m_isSliding )
{
if ( m_renderer->getLength() > 0 )
setFrame( (qreal)(event->pos().x() * m_renderer->getLength() ) / width(), true );
{
qint64 pos = event->pos().x();
pos = qBound( (qint64)0, m_renderer->getLength(), pos );
setFrame( (qreal)(pos * m_renderer->getLength() ) / width(), true );
}
}
}
......
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