Skip to content

Commit 6b8677d

Browse files
committed
finish adding jsdoc comments
1 parent a729724 commit 6b8677d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,13 @@ function getFunctions(time: number = thisLayer.time) {
552552
characterStep: number;
553553
}
554554

555+
/**
556+
*
557+
* @param string The input string to add line breaks to
558+
* @param maxCharacters The maximum characters in each line
559+
* @param minWords The minimum number of words in a line
560+
* @returns The given string with line breaks inserted, where each line has less than `maxCharacters`. If a line has less than the `minWords`, line breaks are inserted more often to avoid short lines.
561+
*/
555562
function breakWithoutOrphans(
556563
string: string,
557564
maxCharacters: number,
@@ -584,6 +591,10 @@ function getFunctions(time: number = thisLayer.time) {
584591
return smartBreak(string, maxCharacters, minWords, options);
585592
}
586593

594+
/**
595+
*
596+
* @returns A scale value that will stay consistent regardless of the parent layers scale
597+
*/
587598
function maintainScale(
588599
parentLayer: Layer = thisLayer.parent as Layer
589600
): Vector {
@@ -609,6 +620,13 @@ function getFunctions(time: number = thisLayer.time) {
609620
) as Vector;
610621
}
611622

623+
/**
624+
*
625+
* @param position The position value to offset from
626+
* @param offset The amount to offset from the given `position`
627+
* @param anchor The direction to offset it, e.g. an anchor of 'topLeft' will offset towards the bottom right
628+
* @returns The given position value plus the offset, in the direction away from the given `anchor`
629+
*/
612630
function offsetFromAnchor(
613631
position: Vector,
614632
[offsetX, offsetY]: Vector,

0 commit comments

Comments
 (0)