Skip to content

Commit

Permalink
Allow virtual list to enable scrolling in two directions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ytom committed Nov 24, 2016
1 parent 80abab2 commit 2841ed6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion Source/Scripts/UI/DragDropManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using FairyGUI;
using UnityEngine;

namespace FairyGUI
Expand Down
11 changes: 10 additions & 1 deletion Source/Scripts/UI/GList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,11 @@ void RefreshVirtualList(object param)
ch += _virtualItems[i].size.y + _lineGap;
if (ch > 0)
ch -= _lineGap;
cw = this.scrollPane.contentWidth;

for (int i = 0; i < _curLineItemCount; i++)
cw += _virtualItems[i].size.x + _columnGap;
if (cw > 0)
cw -= _columnGap;
}
else if (_layout == ListLayoutType.SingleRow || _layout == ListLayoutType.FlowVertical)
{
Expand All @@ -1288,6 +1292,11 @@ void RefreshVirtualList(object param)
if (cw > 0)
cw -= _columnGap;
ch = this.scrollPane.contentHeight;

for (int i = 0; i < _curLineItemCount; i++)
ch += _virtualItems[i].size.y + _lineGap;
if (ch > 0)
ch -= _lineGap;
}
else
{
Expand Down
6 changes: 1 addition & 5 deletions Source/Scripts/UI/IUISource.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace FairyGUI
{
/// <summary>
Expand Down

0 comments on commit 2841ed6

Please sign in to comment.