Skip to content

Commit 2841ed6

Browse files
author
ytom
committed
Allow virtual list to enable scrolling in two directions.
1 parent 80abab2 commit 2841ed6

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

Source/Scripts/UI/DragDropManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using FairyGUI;
43
using UnityEngine;
54

65
namespace FairyGUI

Source/Scripts/UI/GList.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,11 @@ void RefreshVirtualList(object param)
12791279
ch += _virtualItems[i].size.y + _lineGap;
12801280
if (ch > 0)
12811281
ch -= _lineGap;
1282-
cw = this.scrollPane.contentWidth;
1282+
1283+
for (int i = 0; i < _curLineItemCount; i++)
1284+
cw += _virtualItems[i].size.x + _columnGap;
1285+
if (cw > 0)
1286+
cw -= _columnGap;
12831287
}
12841288
else if (_layout == ListLayoutType.SingleRow || _layout == ListLayoutType.FlowVertical)
12851289
{
@@ -1288,6 +1292,11 @@ void RefreshVirtualList(object param)
12881292
if (cw > 0)
12891293
cw -= _columnGap;
12901294
ch = this.scrollPane.contentHeight;
1295+
1296+
for (int i = 0; i < _curLineItemCount; i++)
1297+
ch += _virtualItems[i].size.y + _lineGap;
1298+
if (ch > 0)
1299+
ch -= _lineGap;
12911300
}
12921301
else
12931302
{

Source/Scripts/UI/IUISource.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
1+

62
namespace FairyGUI
73
{
84
/// <summary>

0 commit comments

Comments
 (0)