From bd676805c6875825696c0cc51f359a81d83c101d Mon Sep 17 00:00:00 2001 From: Zeke Chan Date: Mon, 6 Jan 2025 15:33:25 +0800 Subject: [PATCH] Fixed #6996. Updated `setCropUVs` crop calculation. Thanks @CrispMind --- src/textures/Frame.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/textures/Frame.js b/src/textures/Frame.js index ab54a2a72f..51336f8163 100644 --- a/src/textures/Frame.js +++ b/src/textures/Frame.js @@ -573,8 +573,8 @@ var Frame = new Class({ // Need to check for intersection between the cut area and the crop area // If there is none, we set UV to be empty, otherwise set it to be the intersection area - width = Clamp(width, 0, cw - x); - height = Clamp(height, 0, ch - y); + width = Clamp(width, 0, ss.x + cw - x); + height = Clamp(height, 0, ss.y + ch - y); var cropRight = x + width; var cropBottom = y + height;