From a4ec2b24dd077e0a4152a1bad2461800b808d7b6 Mon Sep 17 00:00:00 2001 From: SmallMain Date: Thu, 5 Dec 2024 13:00:24 +0800 Subject: [PATCH] [engine] Fix the issue where UV values are not updated during texture switching --- engine/cocos2d/core/components/CCSprite.js | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/cocos2d/core/components/CCSprite.js b/engine/cocos2d/core/components/CCSprite.js index 20d28dc2..38699ba1 100644 --- a/engine/cocos2d/core/components/CCSprite.js +++ b/engine/cocos2d/core/components/CCSprite.js @@ -495,6 +495,7 @@ var Sprite = cc.Class({ const textureImpl = texture && texture.getImpl(); if (material.getProperty('texture') !== textureImpl) { material.setProperty('texture', texture); + this.setVertsDirty(); } }