Skip to content

First Row Calculation Bug... #45

@Manuzza

Description

@Manuzza

There is a bug in the new release. If you create a table with showHeadings = 0 and a top border then the height of the first row border is calculated incorrectly. This is revealed when the first row is shaded as the shading "sticks out" of the top of the table. The zoomed attached screenshot shows this (I have copied part of the second row and pasted over the first to show the difference). It shows that the shading on the two rows is identical, but the height of the line is not.

first row

The top border is too low by half the height of the rowGap.

The fix is to add this line:

$y1 += ($options['rowGap'] / 2);

in two places in Cezpdf.php. The line needs to go in immediately before:

$y0=$y1;

This line only appears twice in the file so it is easy to find.

In both locations the revised code block looks like this:

            if (!$options['showHeadings']){ // existing line
                $y1 += ($options['rowGap'] / 2); // added line
                $y0=$y1; // existing line
            } // existing line

Manuzza

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