From ef579b67d0fa315345976da85dec875003bc5977 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Teuli=C3=A8re?= Date: Sun, 27 Nov 2005 13:27:57 +0000 Subject: [PATCH] * 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. --- modules/gui/skins2/controls/ctrl_image.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/gui/skins2/controls/ctrl_image.cpp b/modules/gui/skins2/controls/ctrl_image.cpp index 372dfbcf03..99abb95995 100644 --- a/modules/gui/skins2/controls/ctrl_image.cpp +++ b/modules/gui/skins2/controls/ctrl_image.cpp @@ -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 ); + } } -- 2.39.2