useParagraphResize

Deprecated: use useSetParagraphProps with x, y, and width instead. It takes several paragraphs at once and sets the other paragraph properties too.

Returns a function that moves a paragraph and sets its wrap width. The height isn't set: it follows the text content.

const resizeParagraph = useParagraphResize()

resizeParagraph(paragraphId, x, y, width)
  • x and y set the start of the first line's baseline in user space, and width sets the width the text wraps at, in text space units (see useSetParagraphProps for both).
  • An id that doesn't identify an existing paragraph throws InvalidInputError; with no document loaded, the call throws DocumentNotLoadedError.