This commit is contained in:
xiekaidong 2023-06-20 21:18:26 +08:00
commit 4d3f3834ca

View File

@ -62,6 +62,14 @@ function GemCell:refresh(id, cfgInfo)
-- GFunc.centerImgAndTx(self.doubleImg, self.doubleText, 5)
self.doubleOriginText:setText(reward.num)
self.doubleOriginLine:setVisible(true)
self.doubleDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO):ForceMeshUpdate()
local txW = self.doubleDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).renderedWidth
local setWidth = txW + 30
local curWidth = self.doubleNode:getSizeDeltaX()
if setWidth > curWidth then
self.doubleNode:setSizeDeltaX(setWidth)
end
else
self.doubleNode:setVisible(false)
self.doubleOriginLine:setVisible(false)