Subject: | Fwd: cr(vert_offset) change documentation to match code |
Date: | Tue, 02 Sep 2014 12:18:56 -0400 |
To: | bug-PDF-API2 [...] rt.cpan.org |
From: | Phil M Perry <philperry [...] hvc.rr.com> |
[This may be a duplicate. My mail system says that it failed to deliver it.]
Also, I didn't mention that this was in Content.pm (ditto for nl bug
report).
Show quoted text
-------- Original Message --------
Subject: cr(vert_offset) change documentation to match code
Date: Tue, 02 Sep 2014 10:52:19 -0400
From: Phil M Perry <philperry@hvc.rr.com>
Reply-To: philperry@hvc.rr.com
To: bug-PDF-API2@rt.cpan.org
PDF::API2 v2.022 Perl 5.16.3 Windows 7 severity: Important
The cr($vert_offset) method behavior does not appear to match its POD.
Rather than being a vertical offset from the next line down (the wording
is ambiguous), the code appears to place the new line relative to the
CURRENT line, with vertical displacement in points. Thus, cr(0)
overprints the current line because the current x,y is brought back to
the start of the current line. A positive value moves above the current
line, and a negative value below it. $self->lead is ignored.
I have submitted to the maintainer a suggested change to the POD which
documents how the code actually works. It might even be better (more
intuitive) to change the code to go down (-y) by $self->lead, and then
up by -$vert_offset or down by +$vert_offset (the idea being to go DOWN
by leading+offset, rather than swapping signs around).