Backed out changeset: 68e5d9033466
--HG-- branch : develop
This commit is contained in:
parent
9b9bd0eb8c
commit
cea7a4c0cb
2 changed files with 6 additions and 36 deletions
|
@ -101,9 +101,6 @@ namespace NLGUI
|
||||||
// test is a group is a direct child of this interface group
|
// test is a group is a direct child of this interface group
|
||||||
bool isChildGroup(const CInterfaceGroup *group) const;
|
bool isChildGroup(const CInterfaceGroup *group) const;
|
||||||
|
|
||||||
// test is x,y is inside last draw clip aread
|
|
||||||
bool isInViewport(sint32 x, sint32 y) const;
|
|
||||||
|
|
||||||
virtual bool isWindowUnder (sint32 x, sint32 y); // Virtual for menu that is not square
|
virtual bool isWindowUnder (sint32 x, sint32 y); // Virtual for menu that is not square
|
||||||
CInterfaceGroup *getGroupUnder (sint32 x, sint32 y);
|
CInterfaceGroup *getGroupUnder (sint32 x, sint32 y);
|
||||||
virtual bool getViewsUnder (sint32 x, sint32 y, sint32 clipX, sint32 clipY, sint32 clipW, sint32 clipH, std::vector<CViewBase*> &vVB); // Return true if x,y under the group
|
virtual bool getViewsUnder (sint32 x, sint32 y, sint32 clipX, sint32 clipY, sint32 clipW, sint32 clipH, std::vector<CViewBase*> &vVB); // Return true if x,y under the group
|
||||||
|
@ -344,13 +341,8 @@ namespace NLGUI
|
||||||
void alignElements();
|
void alignElements();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Last clip area cached from draw call
|
|
||||||
sint32 _LastClipX;
|
|
||||||
sint32 _LastClipY;
|
|
||||||
sint32 _LastClipW;
|
|
||||||
sint32 _LastClipH;
|
|
||||||
|
|
||||||
void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH, bool drawing = false);
|
void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH);
|
||||||
void restoreClip (sint32 oldSciX, sint32 oldSciY, sint32 oldSciW, sint32 oldSciH);
|
void restoreClip (sint32 oldSciX, sint32 oldSciY, sint32 oldSciW, sint32 oldSciH);
|
||||||
|
|
||||||
// Compute clip contribution for current window, and a previous clipping rectangle. This doesn't change the clip window in the driver.
|
// Compute clip contribution for current window, and a previous clipping rectangle. This doesn't change the clip window in the driver.
|
||||||
|
|
|
@ -77,11 +77,6 @@ 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
|
||||||
|
@ -1259,8 +1254,7 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
|
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
|
||||||
|
|
||||||
// group might be partially hidden (scolling) so test against last visible area
|
if (!isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
if (!isInViewport(eventDesc.getX(), eventDesc.getY()))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool taken = false;
|
bool taken = false;
|
||||||
|
@ -1305,6 +1299,7 @@ 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;
|
||||||
|
@ -1334,7 +1329,7 @@ namespace NLGUI
|
||||||
void CInterfaceGroup::draw ()
|
void CInterfaceGroup::draw ()
|
||||||
{
|
{
|
||||||
sint32 oldSciX, oldSciY, oldSciW, oldSciH;
|
sint32 oldSciX, oldSciY, oldSciW, oldSciH;
|
||||||
makeNewClip (oldSciX, oldSciY, oldSciW, oldSciH, true);
|
makeNewClip (oldSciX, oldSciY, oldSciW, oldSciH);
|
||||||
|
|
||||||
// Display sons only if not total clipped
|
// Display sons only if not total clipped
|
||||||
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
||||||
|
@ -1723,16 +1718,6 @@ 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)
|
||||||
{
|
{
|
||||||
|
@ -1991,10 +1976,11 @@ 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, bool drawing)
|
void CInterfaceGroup::makeNewClip (sint32 &oldSciX, sint32 &oldSciY, sint32 &oldSciW, sint32 &oldSciH)
|
||||||
{
|
{
|
||||||
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
||||||
rVR.getClipWindow (oldSciX, oldSciY, oldSciW, oldSciH);
|
rVR.getClipWindow (oldSciX, oldSciY, oldSciW, oldSciH);
|
||||||
|
@ -2002,14 +1988,6 @@ 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue