diff --git a/.changeset/selfish-rivers-serve.md b/.changeset/selfish-rivers-serve.md new file mode 100644 index 000000000..12dcc8bf6 --- /dev/null +++ b/.changeset/selfish-rivers-serve.md @@ -0,0 +1,5 @@ +--- +"@react-pdf/textkit": patch +--- + +fix issue with indentation shrinking all lines diff --git a/packages/textkit/src/layout/layoutParagraph.js b/packages/textkit/src/layout/layoutParagraph.js index fec2ffcc0..aec782bd1 100644 --- a/packages/textkit/src/layout/layoutParagraph.js +++ b/packages/textkit/src/layout/layoutParagraph.js @@ -82,7 +82,7 @@ const layoutParagraph = (engines, options) => { const rects = generateLineRects(container, height); const availableWidths = rects.map((r) => r.width); - availableWidths[0] -= indent; + availableWidths.unshift(availableWidths[0] - indent); const lines = engines.linebreaker(options)(paragraph, availableWidths);