mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-01-07 10:03:38 +08:00
Prevent any height value being smaller than default height
This commit is contained in:
parent
26fb53f183
commit
6977f1a31c
@ -117,6 +117,7 @@ namespace UnityExplorer.UI.Widgets
|
||||
public void Add(float value)
|
||||
{
|
||||
value = (float)Math.Floor(value);
|
||||
value = Math.Max(DefaultHeight, value);
|
||||
|
||||
int spread = GetRangeSpread(totalHeight, value);
|
||||
|
||||
@ -153,6 +154,7 @@ namespace UnityExplorer.UI.Widgets
|
||||
public void SetIndex(int dataIndex, float height)
|
||||
{
|
||||
height = (float)Math.Floor(height);
|
||||
height = Math.Max(DefaultHeight, height);
|
||||
|
||||
// If the index being set is beyond the DataSource item count, prune and return.
|
||||
if (dataIndex >= ScrollPool.DataSource.ItemCount)
|
||||
|
Loading…
x
Reference in New Issue
Block a user