Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/115-auto-adjust-height #116

Merged
merged 2 commits into from
Dec 20, 2019
Merged

Conversation

johnferchermeli
Copy link
Contributor

@johnferchermeli johnferchermeli commented Nov 13, 2019

Description
Adapt table list to calculate the header and content height to avoid new line issues, as text extrapolating the cell area.

Fix Examples

  • Fix all examples;
  • Add an item to update examples in template;

Auto adjust height

  • Create GetScalarFactor method in Text interface;
  • Create GetLinesQuantity method in Text interface;
  • Extract private method getLines to build lines from words, Text.Add and Text.GetLinesQuantity use this new method;
  • Remove HeaderHeight property from TableList prop;
  • Remove ContentHeight property from TableList prop;
  • Add VerticalPadding in Text prop;
  • Update mocks
  • Extract tablelist from pdf
  • Fix unit tests

Obtain the max number of lines from a column inside the row, multiply this value by the font size and sum the vertical padding;

Captura de Tela 2019-11-12 às 22 53 57

Related Issue
resolve #115

Checklist

check with "x", if applied to your change

  • All methods associated with structs has func (s *struct) method() {} name style.
  • Wrote unit tests for new/changed features.
  • Updated docs/doc.go
  • Updated pkg/pdf/example_test.go
  • Updated README.md
  • Updated all examples inside internal/examples
  • New public methods has comments upside them explaining what it does
  • Executed go fmt github.com/johnfercher/maroto/... to format all files

* Fix all examples;
* Add an item to update examples in template;
@codecov-io
Copy link

codecov-io commented Nov 13, 2019

Codecov Report

Merging #116 into dev will decrease coverage by 3.51%.
The diff coverage is 84.03%.

Impacted file tree graph

@@            Coverage Diff            @@
##              dev     #116     +/-   ##
=========================================
- Coverage   98.31%   94.81%   -3.5%     
=========================================
  Files           8        9      +1     
  Lines         473      520     +47     
=========================================
+ Hits          465      493     +28     
- Misses          4       22     +18     
- Partials        4        5      +1
Impacted Files Coverage Δ
internal/text.go 100% <100%> (ø) ⬆️
pkg/pdf/pdf.go 100% <100%> (+4%) ⬆️
internal/font.go 100% <100%> (ø) ⬆️
pkg/props/prop.go 100% <100%> (ø) ⬆️
internal/tablelist.go 50% <50%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f0a8d7...3741470. Read the comment docs.

@johnferchermeli johnferchermeli force-pushed the feature/115-auto-adjust-height branch 4 times, most recently from bc36d77 to 5cf48a3 Compare November 13, 2019 01:59
@johnferchermeli johnferchermeli force-pushed the feature/115-auto-adjust-height branch 3 times, most recently from be8b4a3 to 1622cec Compare November 17, 2019 03:09
internal/font.go Outdated Show resolved Hide resolved
@johnferchermeli johnferchermeli force-pushed the feature/115-auto-adjust-height branch from 5e77715 to d291a5e Compare December 20, 2019 02:33
@johnferchermeli johnferchermeli force-pushed the feature/115-auto-adjust-height branch from fe3fd2d to 712a6a9 Compare December 20, 2019 02:46
* Create GetScalarFactor method in Text interface;
* Create GetLinesQuantity method in Text interface;
* Extract private method getLines to build lines from words, Text.Add and Text.GetLinesQuantity use this new method;
* Remove HeaderHeight property from TableList prop;
* Remove ContentHeight property from TableList prop;
* Add VerticalPadding in Text prop;
* Update mocks
* Extract tablelist from pdf
* Fix unit tests

> Obtain the max number of lines from a column inside the row, multiply this value by the font size and sum the vertical padding;
@johnferchermeli johnferchermeli force-pushed the feature/115-auto-adjust-height branch from b0453bf to 3741470 Compare December 20, 2019 02:57
@johnfercher johnfercher merged commit 0988a34 into dev Dec 20, 2019
@johnfercher johnfercher deleted the feature/115-auto-adjust-height branch December 20, 2019 03:06
@johnfercher johnfercher mentioned this pull request Dec 20, 2019
felix pushed a commit to felix/maroto that referenced this pull request May 2, 2022
…adjust-height

feature/115-auto-adjust-height
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants