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;