mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-01-09 10:58:57 +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)
|
public void Add(float value)
|
||||||
{
|
{
|
||||||
value = (float)Math.Floor(value);
|
value = (float)Math.Floor(value);
|
||||||
|
value = Math.Max(DefaultHeight, value);
|
||||||
|
|
||||||
int spread = GetRangeSpread(totalHeight, value);
|
int spread = GetRangeSpread(totalHeight, value);
|
||||||
|
|
||||||
@ -153,6 +154,7 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
public void SetIndex(int dataIndex, float height)
|
public void SetIndex(int dataIndex, float height)
|
||||||
{
|
{
|
||||||
height = (float)Math.Floor(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 the index being set is beyond the DataSource item count, prune and return.
|
||||||
if (dataIndex >= ScrollPool.DataSource.ItemCount)
|
if (dataIndex >= ScrollPool.DataSource.ItemCount)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user