mirror of
https://github.com/unidoc/unipdf.git
synced 2025-05-02 22:17:06 +08:00
Make Division support the StyledParagraph component
This commit is contained in:
parent
8e498d43c8
commit
660139b59a
@ -590,7 +590,7 @@ func (cell *TableCell) Width(ctx DrawContext) float64 {
|
||||
}
|
||||
|
||||
// SetContent sets the cell's content. The content is a VectorDrawable, i.e. a Drawable with a known height and width.
|
||||
// The currently supported VectorDrawable is: *Paragraph.
|
||||
// The currently supported VectorDrawable is: *Paragraph, *StyledParagraph.
|
||||
func (cell *TableCell) SetContent(vd VectorDrawable) error {
|
||||
switch t := vd.(type) {
|
||||
case *Paragraph:
|
||||
@ -599,6 +599,13 @@ func (cell *TableCell) SetContent(vd VectorDrawable) error {
|
||||
t.enableWrap = false // No wrapping.
|
||||
}
|
||||
|
||||
cell.content = vd
|
||||
case *StyledParagraph:
|
||||
if t.defaultWrap {
|
||||
// Default styled paragraph settings in table: no wrapping.
|
||||
t.enableWrap = false // No wrapping.
|
||||
}
|
||||
|
||||
cell.content = vd
|
||||
case *Image:
|
||||
cell.content = vd
|
||||
|
Loading…
x
Reference in New Issue
Block a user