From ce7be406cb20252397f07303e0a495e2e3316a72 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Sat, 25 Oct 2025 12:10:18 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B4=B4=E5=9B=BE=E8=A3=81=E5=89=AA?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/src/logger.json | 3 +++ packages/render-assets/src/texture.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/packages/common/src/logger.json b/packages/common/src/logger.json index e2986b4..151f357 100644 --- a/packages/common/src/logger.json +++ b/packages/common/src/logger.json @@ -106,6 +106,9 @@ "72": "Frame count delivered to frame-based animater need to exactly divide texture's height.", "73": "Consistent size is needed when using WebGL2 composer.", "74": "Frame size not match texture's size, incomplete data will be skipped.", + "75": "Material count splitted by grid does not match alias count, some material may have no alias or some alias may not map to a texture. Splitted: $1, alias: $2.", + "76": "Cannot pipe texture store when asset builder is started.", + "77": "Texture is clipped to an area of 0. Ensure that the texture contains your clip rect and clip rect's area is not zero.", "1001": "Item-detail extension needs 'floor-binder' and 'floor-damage' extension as dependency.", "1101": "Cannot add new effect to point effect instance, for there's no more reserve space for it. Please increase the max count of the instance." } diff --git a/packages/render-assets/src/texture.ts b/packages/render-assets/src/texture.ts index 27848f4..bcddde2 100644 --- a/packages/render-assets/src/texture.ts +++ b/packages/render-assets/src/texture.ts @@ -53,6 +53,12 @@ export class Texture implements ITexture { const top = Math.max(0, y); const right = Math.min(this.width, r); const bottom = Math.min(this.height, b); + const width = right - left; + const height = bottom - top; + if (width <= 0 || height <= 0) { + logger.warn(77); + return; + } this.cl = left; this.ct = top; this.width = right - left;