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

Improve text chunk component #181

Merged
merged 3 commits into from
Oct 8, 2019
Merged

Improve text chunk component #181

merged 3 commits into from
Oct 8, 2019

Conversation

adrg
Copy link
Collaborator

@adrg adrg commented Oct 5, 2019

  • Add Wrap method for TextChunk
  • Add Fit method for TextChunk
  • Refactor the paragraph component to use the newly added Wrap method
  • Add TextChunk test file

Addresses #178


This change is Reviewable

@adrg adrg changed the title Improve text chunk Improve text chunk component Oct 5, 2019
@codecov
Copy link

codecov bot commented Oct 8, 2019

Codecov Report

Merging #181 into development will increase coverage by 5.94%.
The diff coverage is 90.12%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #181      +/-   ##
===============================================
+ Coverage        57.54%   63.49%   +5.94%     
===============================================
  Files              189      189              
  Lines            34434    34460      +26     
===============================================
+ Hits             19815    21880    +2065     
+ Misses           12072    12070       -2     
+ Partials          2547      510    -2037
Impacted Files Coverage Δ
creator/styled_paragraph.go 91.11% <83.33%> (+3.61%) ⬆️
creator/paragraph.go 88.73% <90%> (+5.72%) ⬆️
creator/text_chunk.go 90.19% <90.76%> (+4.83%) ⬆️
creator/division.go 89.13% <0%> (+1.08%) ⬆️
model/sighandler/sighandler_rsa_sha1.go 5.68% <0%> (+1.13%) ⬆️
model/outline.go 86.74% <0%> (+1.2%) ⬆️
creator/invoice.go 90.07% <0%> (+1.21%) ⬆️
annotator/form_field.go 14.78% <0%> (+1.4%) ⬆️
creator/toc_line.go 75.39% <0%> (+1.58%) ⬆️
internal/transform/matrix.go 61.66% <0%> (+1.66%) ⬆️
... and 125 more

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 b7dc677...07f7598. Read the comment docs.

Copy link
Contributor

@gunnsth gunnsth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Wondering whether we need to account for line height/cap height?

creator/text_chunk.go Show resolved Hide resolved
}

// Fit fits the chunk into the specified bounding box, cropping off the
// remainder in a new chunk, if it exceeds the specified dimensions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adrg Can you add a note regarding the line height to the comment for Fit function. Probably the only one that needs it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, a note sounds like a good idea. Yes, the Wrap method does not need the line height.

Copy link
Contributor

@gunnsth gunnsth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gunnsth gunnsth merged commit eef3b8f into unidoc:development Oct 8, 2019
@adrg adrg deleted the improve-text-chunk branch October 8, 2019 20:49
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.

2 participants