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

Creator tablecell div image support #179

Merged
merged 12 commits into from
Aug 14, 2018

Conversation

gunnsth
Copy link
Contributor

@gunnsth gunnsth commented Aug 13, 2018

New Division container component for containing multiple Drawables and can wrap across pages (unlike Block). Can be used in table cells to contain multiple paragraphs with different styles.

Support added for Division and Image in table cell.

@gunnsth gunnsth requested a review from s4kibs4mi August 13, 2018 17:17
}
return p.getTextWidth() / 1000.0
}

// Height returns the height of the Paragraph. The height is calculated based on the input text and how it is wrapped
Copy link
Contributor

Choose a reason for hiding this comment

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

Should end with period as godoc style.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it does end with a period (sentence is continued in following line), see

// within the container. Does not include Margins.

@@ -208,7 +210,50 @@ func (table *Table) GeneratePageBlocks(ctx DrawContext) ([]*Block, DrawContext,
// Add diff to last row
Copy link
Contributor

Choose a reason for hiding this comment

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

Should end with period as godoc style.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not so important within function (does not go into godoc), but sure will fix as this is a sentence and is more consistent.

newh := img.Height() + img.margins.top + img.margins.bottom
if newh > h {
diffh := newh - h
// Add diff to last row
Copy link
Contributor

Choose a reason for hiding this comment

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

Should end with period as godoc style.

newh := ctx.Height - h
if newh > h {
diffh := newh - h
// Add diff to last row
Copy link
Contributor

Choose a reason for hiding this comment

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

Should end with period as godoc style.

// Relative mode.
// Move back X after.
ctx.X = origCtx.X
// Return original width
Copy link
Contributor

Choose a reason for hiding this comment

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

Should end with period as godoc style.

ctx.X = origCtx.X
// Return original width
ctx.Width = origCtx.Width
// Add the bottom margin
Copy link
Contributor

Choose a reason for hiding this comment

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

Should end with period as godoc style.


pageHistoryTable.SkipCells(1)

// Add image
Copy link
Contributor

Choose a reason for hiding this comment

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

Should end with period as godoc style.


pageHistoryTable.SkipCells(1)

// Add image
Copy link
Contributor

Choose a reason for hiding this comment

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

Should end with period as godoc style.

Copy link
Contributor

@s4kibs4mi s4kibs4mi left a comment

Choose a reason for hiding this comment

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

Few minor changes required on comments.

@gunnsth gunnsth merged commit ff7c619 into master Aug 14, 2018
@gunnsth gunnsth deleted the creator-tablecell-div-image-support branch August 14, 2018 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants