From a2e51a329c4fb9e86d62aaccaf8508b97de894db Mon Sep 17 00:00:00 2001 From: lrc <571244399@qq.com> Date: Mon, 13 Jul 2026 10:19:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A1=A8=E6=A0=BC=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=BF=87=E5=AE=BD=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E8=A1=A8=E6=A0=BC=E5=A4=96=E5=9B=B4?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E7=BC=BA=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Rendering/Component/XericUIActionTable.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Runtime/XTable/Rendering/Component/XericUIActionTable.cs b/Runtime/XTable/Rendering/Component/XericUIActionTable.cs index 10bc8f5..b549e58 100644 --- a/Runtime/XTable/Rendering/Component/XericUIActionTable.cs +++ b/Runtime/XTable/Rendering/Component/XericUIActionTable.cs @@ -1007,17 +1007,19 @@ namespace XericUI.XTable.Rendering.Component RecalculateTotalSize(); UpdateVisibleRect(); - // 确保 ScrollRect Content 尺寸正确(否则滚动时可能裁剪掉全部内容) + // 确保 ScrollRect Content 尺寸正确(含 padding 偏移量,防止 viewport 裁切边缘边框) RectTransform ctRt = ContentTransform as RectTransform; if (ctRt != null) - ctRt.sizeDelta = new Vector2(m_TotalWidth, m_TotalHeight); + { + float pad2 = m_ContentOffset * 2f; + ctRt.sizeDelta = new Vector2(m_TotalWidth + pad2, m_TotalHeight + pad2); + } - // 更新背景尺寸 + // 更新背景尺寸(仅覆盖网格区域,无需 padding) if (m_BackgroundGo != null) { - float pad = m_ContentOffset * 2f; var bgRt = m_BackgroundGo.GetComponent(); - bgRt.sizeDelta = new Vector2(m_TotalWidth + pad, m_TotalHeight + pad); + bgRt.sizeDelta = new Vector2(m_TotalWidth, m_TotalHeight); } // 归还预制体前,触发所有活跃实例的释放回调 @@ -1102,9 +1104,8 @@ namespace XericUI.XTable.Rendering.Component bgRt.anchorMin = new Vector2(0, 1); bgRt.anchorMax = new Vector2(0, 1); bgRt.pivot = new Vector2(0, 1); - float pad = m_ContentOffset * 2f; bgRt.anchoredPosition = new Vector2(m_ContentOffset, -m_ContentOffset); - bgRt.sizeDelta = new Vector2(m_TotalWidth + pad, m_TotalHeight + pad); + bgRt.sizeDelta = new Vector2(m_TotalWidth, m_TotalHeight); var bgImg = m_BackgroundGo.GetComponent(); bgImg.color = GetCellBgColor(m_DefaultStyleNamespace); @@ -1916,7 +1917,7 @@ namespace XericUI.XTable.Rendering.Component float rightWidth = GetCellBorderWidth(rightNs); int rightCol = c + mergeCS; - if (rightCol < cols) + if (rightCol <= cols) { renderer.DrawLine( new Vector2(rightX, cellY), @@ -1931,7 +1932,7 @@ namespace XericUI.XTable.Rendering.Component float bottomWidth = GetCellBorderWidth(bottomNs); int bottomRow = r + mergeRS; - if (bottomRow < rows) + if (bottomRow <= rows) { renderer.DrawLine( new Vector2(cellX, bottomY),