From dbfbbc414da24f1e889a8b20c46089815a911844 Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 20 Jun 2023 21:07:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/shop/cell/gem_cell.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/app/ui/shop/cell/gem_cell.lua b/lua/app/ui/shop/cell/gem_cell.lua index c7e30afb..82b136a2 100644 --- a/lua/app/ui/shop/cell/gem_cell.lua +++ b/lua/app/ui/shop/cell/gem_cell.lua @@ -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)