techprimate / TPPDF

TPPDF is a simple-to-use PDF builder for iOS and macOS written in Swift
https://techprimate.github.io/TPPDF/
MIT License
730 stars 124 forks source link

Adds custom spacing to lists #352

Open icopano opened 10 months ago

icopano commented 10 months ago

Added the possibility to setup a custom spacing to List. I saw this in a closed issue which was never addressed and thought It would be a nice addition. This implementation assumes the use of a constant spacing.

codecov[bot] commented 10 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (b7c7e7e) 78.86% compared to head (2b49646) 78.86%. Report is 2 commits behind head on main.

Files Patch % Lines
Source/Internal/List/PDFListObject.swift 80.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #352 +/- ## ======================================= Coverage 78.86% 78.86% ======================================= Files 212 212 Lines 12607 12617 +10 ======================================= + Hits 9942 9950 +8 - Misses 2665 2667 +2 ``` | [Flag](https://app.codecov.io/gh/techprimate/TPPDF/pull/352/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=techprimate) | Coverage Δ | | |---|---|---| | [iOS](https://app.codecov.io/gh/techprimate/TPPDF/pull/352/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=techprimate) | `79.77% <80.00%> (+<0.01%)` | :arrow_up: | | [macOS](https://app.codecov.io/gh/techprimate/TPPDF/pull/352/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=techprimate) | `0.00% <0.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=techprimate#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

philprime commented 4 months ago

Hi @icopano! Sorry for my super late response, busy times and this got lost in my inbox.

Your implementation looks straight away, but I will adapt it slightly, so the flatted() method to find the last element isn't called on every single loop.

philprime commented 4 months ago

Ok it looks like I can't push to your branch because of branch protections of the main branch (it's often easier to create a new branch after forking).

Instead I pushed my recommended changes in the branch issue-352-adaptions, and I would kindly request you to adapt your PR according to it. I also merged main into it, because I did a lot of changes in the last weeks, and there is a merge conflict.

Commit with my changes: https://github.com/techprimate/TPPDF/commit/730bcf38908ec5cc995001d4ff90d29dfde14f7a