]> git.sesse.net Git - vlc/commitdiff
* skins2/controls/ctrl_image.cpp: fixed a resizing bug.
authorOlivier Teulière <ipkiss@videolan.org>
Sun, 27 Nov 2005 13:27:57 +0000 (13:27 +0000)
committerOlivier Teulière <ipkiss@videolan.org>
Sun, 27 Nov 2005 13:27:57 +0000 (13:27 +0000)
   A CtrlImage resized with the mosaic method didn't catch events outside of
   the initial (before resizing) size.

modules/gui/skins2/controls/ctrl_image.cpp

index 372dfbcf039263704c9e5c600df4e61f5633e90e..99abb95995cf7d7c097ef1d0decc9bf422d9a7c3 100644 (file)
@@ -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 );
+    }
 }