Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
891 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #include "cbase.h"
  5. #if defined( REPLAY_ENABLED )
  6. #include "replaybrowserbasepanel.h"
  7. //-----------------------------------------------------------------------------
  8. using namespace vgui;
  9. //-----------------------------------------------------------------------------
  10. CReplayBasePanel::CReplayBasePanel( Panel *pParent, const char *pName )
  11. : BaseClass( pParent, pName )
  12. {
  13. }
  14. void CReplayBasePanel::GetPosRelativeToAncestor( Panel *pAncestor, int &nXOut, int &nYOut )
  15. {
  16. nXOut = nYOut = 0;
  17. Panel *pCurrent = this;
  18. while ( pCurrent && pCurrent != pAncestor )
  19. {
  20. int x,y;
  21. pCurrent->GetPos( x, y );
  22. nXOut += x;
  23. nYOut += y;
  24. pCurrent = pCurrent->GetParent();
  25. }
  26. Assert( pAncestor == pCurrent );
  27. }
  28. #endif