Fix: Error when profiles < amount of tiles
This commit is contained in:
1 parent
2dbc84710b
commit
bbe58f764c
1 file changed
+11
-1
@@ -299,7 +299,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public void UpdateList(int offset)
|
public void UpdateList(int offset)
|
||||||
{
|
{
|
||||||
offset = offset.Clamp(0, (int)Math.Ceiling((decimal)(_VisibleProfiles.Count - _Tiles.Count) / _Theme.Tiles.NumW));
|
offset = offset.Clamp(0, _GetMaxOffset());
|
||||||
|
|
||||||
for (int i = 0; i < _Tiles.Count; i++)
|
for (int i = 0; i < _Tiles.Count; i++)
|
||||||
{
|
{
|
||||||
@@ -457,6 +457,16 @@ namespace VocaluxeLib.Menu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int _GetMaxOffset()
|
||||||
|
{
|
||||||
|
int maxOffset = (int)Math.Ceiling((decimal)(_VisibleProfiles.Count - _Tiles.Count) / _Theme.Tiles.NumW);
|
||||||
|
if (maxOffset < 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return maxOffset;
|
||||||
|
}
|
||||||
|
|
||||||
public object GetTheme()
|
public object GetTheme()
|
||||||
{
|
{
|
||||||
return _Theme;
|
return _Theme;
|
||||||
|
|||||||
Reference in new issue
Block a user