You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/index.ts
+30-14Lines changed: 30 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -365,37 +365,53 @@ class Property<PropertyValueType extends Value> {
365
365
}
366
366
367
367
exportclassPathProperty<T>extendsProperty<T>{
368
-
readonlyisClosed: boolean=true;
368
+
/**
369
+
* Creates a path object from a set of points and tangents.
370
+
* @param points An array of number pair arrays representing x,y coordinates of the path points. The array length must be at least 1, and can be of any greater length.
371
+
* @param inTangents An array containing number pair arrays representing the `[x,y]` offset coordinates of the tangent handles to the path points. Required unless no parameters are passed (i.e., `createPath()`). The array length must be the same as points, or you can pass an empty array (`[]`), which will assume the same length as points and `[0,0]` for all tangents.
372
+
* @param outTangents See `inTangents`
373
+
* @param isClosed Determines if the mask is closed. If true, the last point will be connected to the first point.
374
+
*/
369
375
createPath(
370
-
points: Points,
371
-
inTangents: Points|[],
372
-
outTangent: Points|[],
373
-
isClosed: boolean
374
-
): PathValue{
375
-
return[
376
-
[0,0],
377
-
[0,0],
378
-
[0,0],
376
+
points: Points=[
379
377
[0,0],
380
-
];
378
+
[100,0],
379
+
[100,100],
380
+
[0,100],
381
+
],
382
+
inTangents: Points|[]=[],
383
+
outTangents: Points|[]=[],
384
+
is_closed: boolean=true
385
+
): PathValue{
386
+
returnpoints;
381
387
}
382
-
points(time?: number): Vector2D[]{
388
+
/**
389
+
* @returns Whether a path is closed (the last point connected to the first)
390
+
*/
391
+
isClosed(): boolean{
392
+
returntrue;
393
+
}
394
+
/**
395
+
* Retrieves the points array for a path
396
+
* @param time The time at which to sample the path
0 commit comments