Skip to content

Cell width is calculated wrong when cell text contains multiple lines #49

@J-F-Liu

Description

@J-F-Liu

Cell width is calculated wrong when cell text contains multiple lines

        def styled_width_of(text)
          @pdf.width_of(text, @text_options)
        end

Should calculate the width of each line then return the maximum, i.e.

        def styled_width_of(text)
          if text.empty?
            0
          else
            text.lines.collect{|line|@pdf.width_of(line, @text_options)}.max
          end
        end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions