Fix image rotation in vgui::ImagePanel

This commit is contained in:
samisalreadytaken 2023-01-22 17:30:46 +03:00
parent 2d183a8e2a
commit 3f2f562a1e
2 changed files with 23 additions and 0 deletions

View File

@ -61,7 +61,11 @@ public:
int GetNumFrames();
void SetFrame( int nFrame );
#ifdef MAPBASE
void SetRotation( int iRotation );
#else
void SetRotation( int iRotation ) { m_iRotation = iRotation; }
#endif
protected:
virtual void PaintBackground();

View File

@ -73,6 +73,13 @@ void ImagePanel::OnSizeChanged(int newWide, int newTall)
//-----------------------------------------------------------------------------
void ImagePanel::SetImage(IImage *image)
{
#ifdef MAPBASE
if ( image )
{
image->SetRotation( m_iRotation );
}
#endif
m_pImage = image;
Repaint();
}
@ -471,3 +478,15 @@ void ImagePanel::SetFrame( int nFrame )
return m_pImage->SetFrame( nFrame );
}
#ifdef MAPBASE
void ImagePanel::SetRotation( int iRotation )
{
m_iRotation = iRotation;
if ( m_pImage )
{
m_pImage->SetRotation( m_iRotation );
}
}
#endif