From 1d101ebc4a4bb9e5ade8c2107d5cff673aa3e6f9 Mon Sep 17 00:00:00 2001 From: lujun <495904500@qq.com> Date: Sun, 5 Feb 2023 20:58:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/lcc-ui-sorting-group/engine-extend.ts | 9 ++------- assets/test/scenes/test-scene-sorting.scene | 6 +++--- assets/test/scenes/test-scene.scene | 6 +++--- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/assets/lcc-ui-sorting-group/engine-extend.ts b/assets/lcc-ui-sorting-group/engine-extend.ts index 8a6df83..ca8545e 100644 --- a/assets/lcc-ui-sorting-group/engine-extend.ts +++ b/assets/lcc-ui-sorting-group/engine-extend.ts @@ -72,13 +72,6 @@ export function updateOpacity (renderData: RenderData, opacity: number) { } } -const UI_initialize = UI.prototype.initialize; -UI.prototype.initialize = function(){ - this.rendererCache = []; - this.rendererOrder = false; - return UI_initialize.call(this); -} - UI.prototype.flushRendererCache = function(){ const rendererCache = this.rendererCache; if(rendererCache.length > 0){ @@ -104,6 +97,8 @@ UI.prototype.update = function() { if (JSB) { return; } + this.rendererCache = this.rendererCache ?? []; + this.rendererOrder = false; const screens = this._screens; let offset = 0; for (let i = 0; i < screens.length; ++i) { diff --git a/assets/test/scenes/test-scene-sorting.scene b/assets/test/scenes/test-scene-sorting.scene index dba731f..e20bb34 100644 --- a/assets/test/scenes/test-scene-sorting.scene +++ b/assets/test/scenes/test-scene-sorting.scene @@ -244,7 +244,7 @@ "_prefab": null, "_lpos": { "__type__": "cc.Vec3", - "x": 960, + "x": 959.9999999999999, "y": 540, "z": 0 }, @@ -897,8 +897,8 @@ "__prefab": null, "_alignFlags": 45, "_target": null, - "_left": 0, - "_right": 0, + "_left": -1.1368683772161603e-13, + "_right": -1.1368683772161603e-13, "_top": 0, "_bottom": 0, "_horizontalCenter": 0, diff --git a/assets/test/scenes/test-scene.scene b/assets/test/scenes/test-scene.scene index d0b21be..84a0890 100644 --- a/assets/test/scenes/test-scene.scene +++ b/assets/test/scenes/test-scene.scene @@ -244,7 +244,7 @@ "_prefab": null, "_lpos": { "__type__": "cc.Vec3", - "x": 960, + "x": 959.9999999999999, "y": 540, "z": 0 }, @@ -897,8 +897,8 @@ "__prefab": null, "_alignFlags": 45, "_target": null, - "_left": 0, - "_right": 0, + "_left": -1.1368683772161603e-13, + "_right": -1.1368683772161603e-13, "_top": 0, "_bottom": 0, "_horizontalCenter": 0,