Commit ef579b67 authored by Olivier Teulière's avatar Olivier Teulière

* skins2/controls/ctrl_image.cpp: fixed a resizing bug.

   A CtrlImage resized with the mosaic method didn't catch events outside of
   the initial (before resizing) size.
parent fe9ac7c0
......@@ -70,7 +70,19 @@ void CtrlImage::handleEvent( EvtGeneric &rEvent )
bool CtrlImage::mouseOver( int x, int y ) const
{
return m_pImage->hit( x, y );
if( m_resizeMethod == kMosaic &&
x >= 0 && x < getPosition()->getWidth() &&
y >= 0 && y < getPosition()->getHeight() )
{
// In mosaic mode, convert the coordinates to make them fit to the
// size of the original image
return m_pImage->hit( x % m_pImage->getWidth(),
y % m_pImage->getHeight() );
}
else
{
return m_pImage->hit( x, y );
}
}
......
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