修复表格在数据删除方面的用法,增加了CheckUpdate函数用于记录操作栈,合并数据调用。
This commit is contained in:
@@ -347,7 +347,7 @@ namespace XericUI.XTable.Rendering.Component
|
||||
private void Update()
|
||||
{
|
||||
UpdateSelectionAutoScroll();
|
||||
if (m_IsRebuilding || !m_DirtyFlag.IsDirty) return;
|
||||
if (m_IsRebuilding || IsCheckingUpdate || !m_DirtyFlag.IsDirty) return;
|
||||
|
||||
var flags = m_DirtyFlag.Flags;
|
||||
// 仅滚动或选区变更 → 轻刷新(不重建边框/背景/预制体全回收)
|
||||
@@ -385,6 +385,16 @@ namespace XericUI.XTable.Rendering.Component
|
||||
#region 脏标记与滚动回调
|
||||
|
||||
public void MarkDirty(TableDirtyType type)
|
||||
{
|
||||
if (IsCheckingUpdate)
|
||||
{
|
||||
m_UpdateContextStack.Peek().DirtyFlags |= type;
|
||||
return;
|
||||
}
|
||||
ApplyDirty(type);
|
||||
}
|
||||
|
||||
private void ApplyDirty(TableDirtyType type)
|
||||
{
|
||||
m_DirtyFlag.Mark(type);
|
||||
|
||||
@@ -402,6 +412,7 @@ namespace XericUI.XTable.Rendering.Component
|
||||
|
||||
private void OnScrollValueChanged(Vector2 _)
|
||||
{
|
||||
if (IsCheckingUpdate) return;
|
||||
// 防重入:RefreshViewLight 中操作 content 可能触发 ScrollRect 再次回调
|
||||
if (m_IsRefreshingFromScroll) return;
|
||||
m_IsRefreshingFromScroll = true;
|
||||
|
||||
Reference in New Issue
Block a user