mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 19:15:14 -04:00
Draw scrollbar properly when count is 0, should fix #194.
This commit is contained in:
parent
37273895dc
commit
e95f85e961
@ -58,10 +58,12 @@ namespace Launcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GetScrollbarCoords( out int y, out int height ) {
|
void GetScrollbarCoords( out int y, out int height ) {
|
||||||
|
if( Count == 0 ) { y = 0; height = 0; return; }
|
||||||
|
|
||||||
float scale = Height / (float)Count;
|
float scale = Height / (float)Count;
|
||||||
y = (int)Math.Ceiling(CurrentIndex * scale);
|
y = (int)Math.Ceiling( CurrentIndex * scale );
|
||||||
height = (int)Math.Ceiling((maxIndex - CurrentIndex) * scale);
|
height = (int)Math.Ceiling( (maxIndex - CurrentIndex) * scale );
|
||||||
height = Math.Min(y + height, Height) - y;
|
height = Math.Min( y + height, Height ) - y;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetSelected( int index ) {
|
public void SetSelected( int index ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user