aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/replay/vgui/replaybrowserbasepanel.cpp
blob: 8358a2434a9d6e622fdfb25b037915eb2953c087 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//=======================================================================================//

#include "cbase.h"

#if defined( REPLAY_ENABLED )

#include "replaybrowserbasepanel.h"

//-----------------------------------------------------------------------------

using namespace vgui;

//-----------------------------------------------------------------------------

CReplayBasePanel::CReplayBasePanel( Panel *pParent, const char *pName )
:	BaseClass( pParent, pName )
{
}

void CReplayBasePanel::GetPosRelativeToAncestor( Panel *pAncestor, int &nXOut, int &nYOut )
{
	nXOut = nYOut = 0;

	Panel *pCurrent = this;
	while ( pCurrent && pCurrent != pAncestor )
	{
		int x,y;
		pCurrent->GetPos( x, y );
		nXOut += x;
		nYOut += y;
		pCurrent = pCurrent->GetParent();
	}

	Assert( pAncestor == pCurrent );
}

#endif