GameUI: fix propotional scale

This commit is contained in:
nillerusr
2022-04-16 12:20:36 +03:00
parent 23a370d9bb
commit 0772ca1063
12 changed files with 57 additions and 36 deletions
+4 -5
View File
@@ -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;
}