From c5adf3e22a5cdfb185a4befc22ef0cd079a7eb33 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 02 九月 2025 22:30:10 +0800
Subject: [PATCH] 117 【武将】武将系统 - 天赋显示,修复描边文字遇到mask问题
---
Main/System/SkillUI/SkillBaseCell.cs | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/Main/System/SkillUI/SkillBaseCell.cs b/Main/System/SkillUI/SkillBaseCell.cs
index 77101a2..7101b77 100644
--- a/Main/System/SkillUI/SkillBaseCell.cs
+++ b/Main/System/SkillUI/SkillBaseCell.cs
@@ -109,7 +109,18 @@
var scale = 1f;
var rect = cellContainer.GetComponent<RectTransform>();
var parentRect = transform.GetComponent<RectTransform>();
- scale = parentRect.sizeDelta.x / rect.sizeDelta.x;
+ float width = parentRect.sizeDelta.x;
+ if (width <= 0f)
+ {
+ //澶栭儴鎺у埗浜嗗昂瀵歌幏鍙栦负0
+ GridLayoutGroup grid = GetComponentInParent<GridLayoutGroup>();
+ if (grid != null)
+ {
+ width = grid.cellSize.x;
+ }
+
+ }
+ scale = width / rect.sizeDelta.x;
cellContainer.transform.localScale = new Vector3(scale, scale, scale);
}
}
--
Gitblit v1.8.0