diff --git a/cocos/2d/components/sprite.ts b/cocos/2d/components/sprite.ts index 2b7c74f50c..d14e39839e 100644 --- a/cocos/2d/components/sprite.ts +++ b/cocos/2d/components/sprite.ts @@ -525,6 +525,12 @@ export class Sprite extends Renderable2D { } } + public onDisable () { + if (this._spriteFrame && this._type === SpriteType.SLICED) { + this._spriteFrame.off(SpriteFrame.EVENT_UV_UPDATED, this._updateUVs, this); + } + } + public onDestroy () { this.destroyRenderData(); if (EDITOR) { diff --git a/cocos/2d/renderer/render-data.ts b/cocos/2d/renderer/render-data.ts index 13176180a8..7fd4ec4ec0 100644 --- a/cocos/2d/renderer/render-data.ts +++ b/cocos/2d/renderer/render-data.ts @@ -220,9 +220,7 @@ export class RenderData extends BaseRenderData { this.hashDirty = true; } if (this.hashDirty) { - const hashString = ` ${this.layer} ${this.blendHash} ${this.textureHash}`; - this.dataHash = murmurhash2_32_gc(hashString, 666); - this.hashDirty = false; + this.updateHash(); } }