Skip to content

Commit

Permalink
fix(textkit): make indentation only affect first line. (#2975)
Browse files Browse the repository at this point in the history
  • Loading branch information
daslaf authored Nov 26, 2024
1 parent 1916e84 commit 00bfdc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/selfish-rivers-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-pdf/textkit": patch
---

fix issue with indentation shrinking all lines
2 changes: 1 addition & 1 deletion packages/textkit/src/layout/layoutParagraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 00bfdc1

Please sign in to comment.