@ -77,6 +77,11 @@ namespace NLGUI
_LUAEnvTableCreated = false ;
_LUAEnvTableCreated = false ;
_DepthForZSort = 0.f ;
_DepthForZSort = 0.f ;
_LastClipX = 0 ;
_LastClipY = 0 ;
_LastClipW = 0 ;
_LastClipH = 0 ;
# ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS
# ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS
CInterfaceManager : : getInstance ( ) - > DebugTrackGroupsCreated ( this ) ;
CInterfaceManager : : getInstance ( ) - > DebugTrackGroupsCreated ( this ) ;
# endif
# endif
@ -1254,7 +1259,8 @@ namespace NLGUI
{
{
const NLGUI : : CEventDescriptorMouse & eventDesc = ( const NLGUI : : CEventDescriptorMouse & ) event ;
const NLGUI : : CEventDescriptorMouse & eventDesc = ( const NLGUI : : CEventDescriptorMouse & ) event ;
if ( ! isIn ( eventDesc . getX ( ) , eventDesc . getY ( ) ) )
// group might be partially hidden (scolling) so test against last visible area
if ( ! isInViewport ( eventDesc . getX ( ) , eventDesc . getY ( ) ) )
return false ;
return false ;
bool taken = false ;
bool taken = false ;
@ -1299,7 +1305,6 @@ namespace NLGUI
}
}
if ( eventDesc . getEventTypeExtended ( ) = = NLGUI : : CEventDescriptorMouse : : mousewheel )
if ( eventDesc . getEventTypeExtended ( ) = = NLGUI : : CEventDescriptorMouse : : mousewheel )
{
{
// handle the Mouse Wheel only if interesting
if ( _H > _MaxH )
if ( _H > _MaxH )
{
{
CInterfaceGroup * currParent = _Parent ;
CInterfaceGroup * currParent = _Parent ;
@ -1329,7 +1334,7 @@ namespace NLGUI
void CInterfaceGroup : : draw ( )
void CInterfaceGroup : : draw ( )
{
{
sint32 oldSciX , oldSciY , oldSciW , oldSciH ;
sint32 oldSciX , oldSciY , oldSciW , oldSciH ;
makeNewClip ( oldSciX , oldSciY , oldSciW , oldSciH );
makeNewClip ( oldSciX , oldSciY , oldSciW , oldSciH , true );
// Display sons only if not total clipped
// Display sons only if not total clipped
CViewRenderer & rVR = * CViewRenderer : : getInstance ( ) ;
CViewRenderer & rVR = * CViewRenderer : : getInstance ( ) ;
@ -1718,6 +1723,16 @@ namespace NLGUI
( y < = ( _YReal + _HReal ) ) ) ;
( y < = ( _YReal + _HReal ) ) ) ;
}
}
// ------------------------------------------------------------------------------------------------
bool CInterfaceGroup : : isInViewport ( sint32 x , sint32 y ) const
{
return (
( x > _LastClipX ) & &
( x < ( _LastClipX + _LastClipW ) ) & &
( y > _LastClipY ) & &
( y < ( _LastClipY + _LastClipH ) ) ) ;
}
// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------
CInterfaceGroup * CInterfaceGroup : : getGroupUnder ( sint32 x , sint32 y )
CInterfaceGroup * CInterfaceGroup : : getGroupUnder ( sint32 x , sint32 y )
{
{
@ -1976,11 +1991,10 @@ namespace NLGUI
newSciYDest = newSciY ;
newSciYDest = newSciY ;
newSciWDest = newSciW /* - _MarginLeft*/ ;
newSciWDest = newSciW /* - _MarginLeft*/ ;
newSciHDest = newSciH ;
newSciHDest = newSciH ;
}
}
// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------
void CInterfaceGroup : : makeNewClip ( sint32 & oldSciX , sint32 & oldSciY , sint32 & oldSciW , sint32 & oldSciH )
void CInterfaceGroup : : makeNewClip ( sint32 & oldSciX , sint32 & oldSciY , sint32 & oldSciW , sint32 & oldSciH , bool drawing )
{
{
CViewRenderer & rVR = * CViewRenderer : : getInstance ( ) ;
CViewRenderer & rVR = * CViewRenderer : : getInstance ( ) ;
rVR . getClipWindow ( oldSciX , oldSciY , oldSciW , oldSciH ) ;
rVR . getClipWindow ( oldSciX , oldSciY , oldSciW , oldSciH ) ;
@ -1988,6 +2002,14 @@ namespace NLGUI
sint32 newSciX , newSciY , newSciW , newSciH ;
sint32 newSciX , newSciY , newSciW , newSciH ;
computeCurrentClipContribution ( oldSciX , oldSciY , oldSciW , oldSciH , newSciX , newSciY , newSciW , newSciH ) ;
computeCurrentClipContribution ( oldSciX , oldSciY , oldSciW , oldSciH , newSciX , newSciY , newSciW , newSciH ) ;
rVR . setClipWindow ( newSciX , newSciY , newSciW , newSciH ) ;
rVR . setClipWindow ( newSciX , newSciY , newSciW , newSciH ) ;
if ( drawing )
{
_LastClipX = newSciX ;
_LastClipY = newSciY ;
_LastClipW = newSciW ;
_LastClipH = newSciH ;
}
}
}
// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------