summaryrefslogtreecommitdiff
path: root/apps/web/src/masks
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/masks')
-rw-r--r--apps/web/src/masks/freeform/definition.ts30
-rw-r--r--apps/web/src/masks/types.ts6
2 files changed, 7 insertions, 29 deletions
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,
+ }),
}),
};
}
diff --git a/apps/web/src/masks/types.ts b/apps/web/src/masks/types.ts
index 59f84f71..afc79a8c 100644
--- a/apps/web/src/masks/types.ts
+++ b/apps/web/src/masks/types.ts
@@ -187,11 +187,10 @@ export interface MaskFeatures {
export type MaskHandleIcon = "rotate" | "feather";
-export type MaskHandleKind = "corner" | "edge" | "icon" | "point" | "tangent";
+export type MaskHandleKind = "corner" | "edge" | "icon" | "point";
type Side = "left" | "right" | "top" | "bottom";
type CornerXY = { x: "left" | "right"; y: "top" | "bottom" };
-type CustomTangent = "in" | "out";
export type MaskHandleId =
| { kind: "position" }
@@ -201,7 +200,6 @@ export type MaskHandleId =
| { kind: "edge"; side: Side }
| { kind: "corner"; corner: CornerXY }
| { kind: "anchor"; pointId: string }
- | { kind: "tangent"; pointId: string; side: CustomTangent }
| { kind: "segment"; index: number };
export function maskHandleIdKey({ id }: { id: MaskHandleId }): string {
@@ -217,8 +215,6 @@ export function maskHandleIdKey({ id }: { id: MaskHandleId }): string {
return `${id.corner.y}-${id.corner.x}`;
case "anchor":
return `point:${id.pointId}:anchor`;
- case "tangent":
- return `point:${id.pointId}:${id.side}`;
case "segment":
return `segment:${id.index}`;
}