From 23187b0b6a9f179bdb68578fc4bdaa8414b8316d Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Sat, 2 May 2026 01:33:20 +0200 Subject: refactor: remove dead tangent handle variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The { kind: "tangent" } MaskHandleId variant was never constructed — neither getFreeformDisplayHandles nor any other code ever produced a tangent handle object. The in/out control-arm branches in computeFreeformParamUpdate, the tangent case in maskHandleIdKey, and the CUSTOM_MASK_TANGENT_SIZE rendering path in mask-handles.tsx were all unreachable. Removed all four dead paths and removed "tangent" from MaskHandleKind. Co-authored-by: Cursor --- apps/web/src/masks/freeform/definition.ts | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'apps/web/src/masks/freeform') diff --git a/apps/web/src/masks/freeform/definition.ts b/apps/web/src/masks/freeform/definition.ts index b657218d..ae30110e 100644 --- a/apps/web/src/masks/freeform/definition.ts +++ b/apps/web/src/masks/freeform/definition.ts @@ -257,7 +257,7 @@ function computeFreeformParamUpdate({ }; } - if (handleId.kind !== "anchor" && handleId.kind !== "tangent") { + if (handleId.kind !== "anchor") { return {}; } @@ -279,29 +279,11 @@ function computeFreeformParamUpdate({ path: updateFreeformPathMaskPoint({ points, pointId: handleId.pointId, - updater: (point) => { - if (handleId.kind === "anchor") { - return { - ...point, - x: localPoint.x, - y: localPoint.y, - }; - } - - if (handleId.side === "in") { - return { - ...point, - inX: localPoint.x - point.x, - inY: localPoint.y - point.y, - }; - } - - return { - ...point, - outX: localPoint.x - point.x, - outY: localPoint.y - point.y, - }; - }, + updater: (point) => ({ + ...point, + x: localPoint.x, + y: localPoint.y, + }), }), }; } -- cgit v1.3.1