Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 6977f1a

Browse files
committed
Prevent any height value being smaller than default height
1 parent 26fb53f commit 6977f1a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/UI/Widgets/ScrollPool/DataHeightCache.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ private int GetRangeSpread(float startPosition, float height)
117117
public void Add(float value)
118118
{
119119
value = (float)Math.Floor(value);
120+
value = Math.Max(DefaultHeight, value);
120121

121122
int spread = GetRangeSpread(totalHeight, value);
122123

@@ -153,6 +154,7 @@ public void RemoveLast()
153154
public void SetIndex(int dataIndex, float height)
154155
{
155156
height = (float)Math.Floor(height);
157+
height = Math.Max(DefaultHeight, height);
156158

157159
// If the index being set is beyond the DataSource item count, prune and return.
158160
if (dataIndex >= ScrollPool.DataSource.ItemCount)

0 commit comments

Comments
 (0)