Menu

#876 Cell padding should not be multiplied with number of lines in getStringHeight

v1.0_(example)
closed
nobody
None
1
2014-01-15
2014-01-03
Filip Komar
No

Following line in function getStringHeight which was modified in version 6.0.050 calculates to big height as getCellHeight adds TB cell padding which is then multiplied with $lines:

$height = $lines * $this->getCellHeight($this->FontSize);

Discussion

  • Filip Komar

    Filip Komar - 2014-01-03

    BTW. As a temporary workaround I created getCellHeight_no_padding which is called only from getStringHeight function and it works as it did before 6.0.050.

     
  • Nicola Asuni

    Nicola Asuni - 2014-01-03
    • status: open --> closed
     
  • Nicola Asuni

    Nicola Asuni - 2014-01-03

    OK. Fixed on TCPDF 6.0.053.
    Thank you for reporting this issue.

     
  • Filip Komar

    Filip Komar - 2014-01-15

    Unfortunately this bug reappeared in 6.0.054. See part of a diff:
    - $height = $this->getCellHeight(($lines * $this->FontSize), $autopadding);
    + $height = $lines * $this->getCellHeight($this->FontSize, $autopadding);

    Should I suggest a test in one of the examples?

     
  • Nicola Asuni

    Nicola Asuni - 2014-01-15

    In the 6.0.055 vertion of TCPDF the line is:

    $height = $this->getCellHeight(($lines * $this->FontSize), $autopadding);

    That is correct and consistent, as shown in the example n. 5.

     

Log in to post a comment.