Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
wpf
提交
83437122
W
wpf
项目概览
dotNET Platform
/
wpf
12 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wpf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
83437122
编写于
1月 19, 2022
作者:
S
Sam Bent
提交者:
GitHub
1月 19, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rect with negative height is not allowed (#5842)
上级
5e894ad8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
56 addition
and
8 deletion
+56
-8
src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/VirtualizingStackPanel.cs
...amework/System/Windows/Controls/VirtualizingStackPanel.cs
+56
-8
未找到文件。
src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/VirtualizingStackPanel.cs
浏览文件 @
83437122
...
...
@@ -3542,8 +3542,11 @@ protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args
{
ScrollTracer.Trace(this, ScrollTraceOp.ItemsChanged,
args.Action,
"pos:", args.OldPosition, args.Position,
"stpos:", args.Position, Generator.IndexFromGeneratorPosition(args.Position),
"oldpos:", args.OldPosition, Generator.IndexFromGeneratorPosition(args.OldPosition),
"count:", args.ItemCount, args.ItemUICount,
"ev:", _firstItemInExtendedViewportIndex, "+", _itemsInExtendedViewportCount,
"ext:", IsScrolling ? _scrollData._extent : Size.Empty,
MeasureInProgress ? "MeasureInProgress" : String.Empty);
}
...
...
@@ -3636,10 +3639,10 @@ protected override bool ShouldItemsChangeAffectLayoutCore(bool areItemChangesLoc
{
case NotifyCollectionChangedAction.Remove:
{
int start
OldIndex = Generator.IndexFromGeneratorPosition(args.Old
Position);
int start
Index = Generator.IndexFromGeneratorPosition(args.
Position);
shouldItemsChangeAffectLayout = args.ItemUICount > 0 ||
(start
Old
Index < _firstItemInExtendedViewportIndex + _itemsInExtendedViewportCount);
(startIndex < _firstItemInExtendedViewportIndex + _itemsInExtendedViewportCount);
}
break;
...
...
@@ -3765,6 +3768,7 @@ private void UpdateExtent(bool areItemChangesLocal)
{
bool isHorizontal = (Orientation == Orientation.Horizontal);
bool isVSP45Compat = IsVSP45Compat;
bool isTracing = ScrollTracer.IsEnabled && ScrollTracer.IsTracing(this);
ItemsControl itemsControl;
GroupItem groupItem;
...
...
@@ -3881,6 +3885,11 @@ private void UpdateExtent(bool areItemChangesLocal)
_scrollData._extent.Height = distance;
}
if (isTracing)
{
ScrollTracer.Trace(this, ScrollTraceOp.UpdateExtent, "ext:", _scrollData._extent);
}
ScrollOwner.InvalidateScrollInfo();
}
else if (virtualizationInfoProvider != null)
...
...
@@ -3899,6 +3908,11 @@ private void UpdateExtent(bool areItemChangesLocal)
pixelSize.Height = distance;
}
if (isTracing)
{
ScrollTracer.Trace(this, ScrollTraceOp.UpdateExtent, "ids.Px:", pixelSize);
}
itemDesiredSizes = new HierarchicalVirtualizationItemDesiredSizes(
itemDesiredSizes.LogicalSize,
itemDesiredSizes.LogicalSizeInViewport,
...
...
@@ -3921,6 +3935,11 @@ private void UpdateExtent(bool areItemChangesLocal)
logicalSize.Height = distance;
}
if (isTracing)
{
ScrollTracer.Trace(this, ScrollTraceOp.UpdateExtent, "ids.Lg:", logicalSize);
}
itemDesiredSizes = new HierarchicalVirtualizationItemDesiredSizes(
logicalSize,
itemDesiredSizes.LogicalSizeInViewport,
...
...
@@ -4770,7 +4789,12 @@ private void ClearIsScrollActive()
if (DoubleUtil.GreaterThan(extendedViewport.X + extendedViewport.Width, _scrollData._extent.Width))
{
extendedViewport.Width = _scrollData._extent.Width - extendedViewport.X;
// during Measure the viewport should never start after the extent, but this is possible
// during add/remove item
#if DBG // can't use Debug.Assert during Measure - the dispatcher is disabled and can't open the dialog
Invariant.Assert(!MeasureInProgress || extendedViewport.X <= _scrollData._extent.Width, "viewport starts after extent");
#endif
extendedViewport.Width = Math.Max(_scrollData._extent.Width - extendedViewport.X, 0.0);
}
}
}
...
...
@@ -4805,7 +4829,12 @@ private void ClearIsScrollActive()
if (DoubleUtil.GreaterThan(extendedViewport.X + extendedViewport.Width / approxSizeOfLogicalUnit, _scrollData._extent.Width))
{
extendedViewport.Width = (_scrollData._extent.Width - extendedViewport.X) * approxSizeOfLogicalUnit;
// during Measure the viewport should never start after the extent, but this is possible
// during add/remove item
#if DBG // can't use Debug.Assert during Measure - the dispatcher is disabled and can't open the dialog
Invariant.Assert(!MeasureInProgress || extendedViewport.X <= _scrollData._extent.Width, "viewport starts after extent");
#endif
extendedViewport.Width = Math.Max(_scrollData._extent.Width - extendedViewport.X, 0.0) * approxSizeOfLogicalUnit;
}
}
}
...
...
@@ -4876,7 +4905,12 @@ private void ClearIsScrollActive()
if (DoubleUtil.GreaterThan(extendedViewport.Y + extendedViewport.Height, _scrollData._extent.Height))
{
extendedViewport.Height = _scrollData._extent.Height - extendedViewport.Y;
// during Measure the viewport should never start after the extent, but this is possible
// during add/remove item
#if DBG // can't use Debug.Assert during Measure - the dispatcher is disabled and can't open the dialog
Invariant.Assert(!MeasureInProgress || extendedViewport.Y <= _scrollData._extent.Height, "viewport starts after extent");
#endif
extendedViewport.Height = Math.Max(_scrollData._extent.Height - extendedViewport.Y, 0.0);
}
}
}
...
...
@@ -4911,7 +4945,12 @@ private void ClearIsScrollActive()
if (DoubleUtil.GreaterThan(extendedViewport.Y + extendedViewport.Height / approxSizeOfLogicalUnit, _scrollData._extent.Height))
{
extendedViewport.Height = (_scrollData._extent.Height - extendedViewport.Y) * approxSizeOfLogicalUnit;
// during Measure the viewport should never start after the extent, but this is possible
// during add/remove item [DDVSO 1405478]
#if DBG // can't use Debug.Assert during Measure - the dispatcher is disabled and can't open the dialog
Invariant.Assert(!MeasureInProgress || extendedViewport.Y <= _scrollData._extent.Height, "viewport starts after extent");
#endif
extendedViewport.Height = Math.Max(_scrollData._extent.Height - extendedViewport.Y, 0.0) * approxSizeOfLogicalUnit;
}
}
}
...
...
@@ -11962,7 +12001,7 @@ private class ScrollTracer
{
#region static members
const int s_StfFormatVersion =
2
; // Format of output file
const int s_StfFormatVersion =
3
; // Format of output file
const int s_MaxTraceRecords = 30000; // max length of in-memory _traceList
const int s_MinTraceRecords = 5000; // keep this many records after flushing
const int s_DefaultLayoutUpdatedThreshold = 20; // see _luThreshold
...
...
@@ -12252,6 +12291,12 @@ private static string BuildDetail(object[] args)
"{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11}",
"{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12}",
"{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13}",
"{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14}",
"{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15}",
"{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16}",
"{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16} {17}",
"{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16} {17} {18}",
"{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16} {17} {18} {19}",
};
#endregion static members
...
...
@@ -12727,6 +12772,9 @@ private enum ScrollTraceOp: ushort
/****** Added in Version 1 ******/
SetContainerSize,
SizeChangeDuringAnchorScroll,
/****** Added in Version 3 ******/
UpdateExtent,
}
private class ScrollTraceRecord
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录