mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
GameUI: fix propotional scale
This commit is contained in:
@@ -230,7 +230,6 @@ void Slider::SetInverted( bool bInverted )
|
||||
m_bInverted = bInverted;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Send a message to interested parties when the slider moves
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -386,9 +385,9 @@ void Slider::GetTrackRect( int& x, int& y, int& w, int& h )
|
||||
GetPaintSize( wide, tall );
|
||||
|
||||
x = 0;
|
||||
y = 8;
|
||||
y = IsProportional() ? scheme()->GetProportionalScaledValue( 8.f ) : 8;;
|
||||
w = wide - (int)_nobSize;
|
||||
h = 4;
|
||||
h = IsProportional() ? scheme()->GetProportionalScaledValue( 4.f ) : 4;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -524,7 +523,7 @@ void Slider::DrawNob()
|
||||
#endif
|
||||
surface()->DrawSetColor(col);
|
||||
|
||||
int nobheight = 16;
|
||||
int nobheight = IsProportional() ? scheme()->GetProportionalScaledValue( 16.f ) : 16.f;
|
||||
|
||||
surface()->DrawFilledRect(
|
||||
_nobPos[0],
|
||||
@@ -941,7 +940,7 @@ void Slider::SetButtonOffset(int buttonOffset)
|
||||
|
||||
void Slider::SetThumbWidth( int width )
|
||||
{
|
||||
_nobSize = (float)width;
|
||||
_nobSize = IsProportional() ? scheme()->GetProportionalScaledValue( (float)width) : (float)width;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user