Add comments

This commit is contained in:
Sidharth Vinod
2023-07-07 10:05:05 +05:30
parent d58c41dbc0
commit 28406fc9c4

View File

@@ -76,6 +76,15 @@ function computeWidthOfText(parentNode: any, lineHeight: number, line: MarkdownL
return textLength; return textLength;
} }
/**
* Creates a formatted text element by breaking lines and applying styles based on
* the given structuredText.
*
* @param width - The maximum allowed width of the text.
* @param g - The parent group element to append the formatted text.
* @param structuredText - The structured text data to format.
* @param addBackground - Whether to add a background to the text.
*/
function createFormattedText( function createFormattedText(
width: number, width: number,
g: any, g: any,
@@ -117,6 +126,13 @@ function createFormattedText(
} }
} }
/**
* Updates the text content and styles of the given tspan element based on the
* provided wrappedLine data.
*
* @param tspan - The tspan element to update.
* @param wrappedLine - The line data to apply to the tspan element.
*/
function updateTextContentAndStyles(tspan: any, wrappedLine: MarkdownWord[]) { function updateTextContentAndStyles(tspan: any, wrappedLine: MarkdownWord[]) {
tspan.text(''); tspan.text('');