Commit 54140ab
committed
Fix: Ensure consistent line rendering for cell borders
The issue reported that footer line widths were not appearing the same
as header line widths, even when configured with the same numerical
lineWidth value (e.g., 2) and color.
This was likely due to the jsPDF draw color state not being explicitly
re-applied immediately before drawing each border segment within the
`drawCellBorders` function. While `lineWidth` was set, the `lineColor`
relied on an earlier `applyStyles` call, which could lead to
inconsistencies if the state changed.
This commit modifies the `drawLine` helper function within
`drawCellBorders` in `src/tableDrawer.ts` to:
1. Accept `cell.styles.lineColor` as a parameter.
2. Explicitly call `jsPDFDoc.setDrawColor()` with this color
immediately before `jsPDFDoc.setLineWidth()` and the
`jsPDFDoc.line()` command.
This ensures that both line width and line color are correctly
set in the jsPDF graphics state for each border segment (top, bottom,
left, right) for all cells, improving rendering consistency across
table sections (head, body, foot).1 parent f3aac80 commit 54140ab
1 file changed
+16
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
503 | | - | |
| 503 | + | |
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
517 | | - | |
| 517 | + | |
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
| 531 | + | |
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| |||
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
545 | | - | |
| 545 | + | |
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| 554 | + | |
554 | 555 | | |
555 | | - | |
556 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
557 | 566 | | |
558 | 567 | | |
559 | 568 | | |
| |||
0 commit comments