Skip to content

Commit

Permalink
vgui2: correctly initialize root panel size
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfulon committed Nov 8, 2022
1 parent 5ecc53a commit 4c63344
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vgui2-dev
Submodule vgui2-dev updated 1 files
+5 −3 include/IBaseUI.h
8 changes: 4 additions & 4 deletions vgui2_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class BaseUI : public IBaseUI
public:
BaseUI() : initialized( 0 ), numFactories( 0 ) { }
void Initialize( CreateInterfaceFn *factories, int count ) override;
void Start( IEngineSurface *engineSurface, int interfaceVersion ) override;
void Start( int width, int height ) override;
void Shutdown() override;
int Key_Event( int down, int keynum, const char *pszCurrentBinding ) override;
void CallEngineSurfaceAppHandler( void *event, void *userData ) override;
Expand Down Expand Up @@ -126,14 +126,14 @@ void BaseUI::Initialize( CreateInterfaceFn *factories, int count )
initialized = 1;
}

void BaseUI::Start( IEngineSurface *engineSurface, int interfaceVersion )
void BaseUI::Start( int width, int height )
{
if ( !initialized )
return;

rootPanel = new RootPanel( nullptr, "RootPanel" );
rootPanel->SetCursor( vgui2::dc_none );
rootPanel->SetBounds( 0, 0, 40, 30 );
rootPanel->SetBounds( 0, 0, width, height );
rootPanel->SetPaintBorderEnabled( false );
rootPanel->SetPaintBackgroundEnabled( false );
rootPanel->SetPaintEnabled( false );
Expand Down Expand Up @@ -276,7 +276,7 @@ void VGUI2_Startup( const char *clientlib, int width, int height )
factories[2] = GetFactory( LoadModule( clientlib ) );

baseUI.Initialize( factories, 3 );
baseUI.Start( nullptr, 0 );
baseUI.Start( width, height );
}

rootPanel->SetBounds( 0, 0, width, height );
Expand Down

0 comments on commit 4c63344

Please sign in to comment.