Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 29771
Status: resolved
Priority: 20/
Queue: Imager

People
Owner: TONYC [...] cpan.org
Requestors: nikita.dedik [...] bulyon.com
TONYC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.60
Fixed in: (no value)



Subject: Imager::Font::Wrap doesn't count the last line length
Date: Fri, 5 Oct 2007 00:21:46 +1000
To: bug-Imager [...] rt.cpan.org
From: tonyc [...] cpan.org
(Other's email addresses obscured) ----- Forwarded message from "Eleneldil G. Arilou" <eleneldil@xxxx> ----- X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on develop-help.com X-Spam-Level: Date: Thu, 4 Oct 2007 18:04:32 +0400 (MSD) From: "Eleneldil G. Arilou" <eleneldil@xxxx> To: tony@develop-help.com Subject: Imager::Font::Wrap doesn't count the last line length Hi! When I supply the savepos parameter to the wrap_text methot, the value it saves in the specified scalar really is the total count of characters drawn except of the last line part. I think the problem is here: if (length $line && !$state{full}) { _format_line(\%state, 0, $line, 0); } if ($input{savepos}) { ${$input{savepos}} = $linepos; } The length of the trailing $line was not counted in the $linepos before and it not here too. ---------------- ------------------ With best regards, ? ?????????? ???????????, Eleneldil G. Arilou ??????????? ?. ?????? (Danil Lavrentyuk) (????? ?????????) eleneldil@xxxx; ... Show quoted text
----- End forwarded message -----
Subject: Imager::Font::Wrap doesn't correctly set savepos
When I supply the savepos parameter to the wrap_text method, the value it saves in the specified scalar really is the total count of characters drawn *except* the last line. I think the problem is here: if (length $line && !$state{full}) { _format_line(\%state, 0, $line, 0); } if ($input{savepos}) { ${$input{savepos}} = $linepos; } The length of the trailing $line is not taken into account! The corrected code looks like this: if (length $line && !$state{full}) { $linepos += length $line if _format_line(\%state, 0, $line, 0); } if ($input{savepos}) { ${$input{savepos}} = $linepos; } Thanks!!
On Thu Oct 04 10:30:03 2007, nikita.dedik@bulyon.com wrote: Show quoted text
> The corrected code looks like this: > > if (length $line && !$state{full}) { > $linepos += length $line > if _format_line(\%state, 0, $line, 0); > } > if ($input{savepos}) { > ${$input{savepos}} = $linepos; > }
Thanks for that, I plan to have this fixed for 0.61. Tony
From: nikita.dedik [...] bulyon.com
Tony, thanks a lot! And for the whole deal with Imager!! It's awesome!
On Thu Oct 04 10:30:03 2007, nikita.dedik@bulyon.com wrote: Show quoted text
> When I supply the savepos parameter to the wrap_text method, the value > it saves in the specified scalar really is the total count of > characters drawn *except* the last line. > > I think the problem is here: > > if (length $line && !$state{full}) { > _format_line(\%state, 0, $line, 0); > } > if ($input{savepos}) { > ${$input{savepos}} = $linepos; > } > > The length of the trailing $line is not taken into account!
Hi, This problem is fixed in Imager 0.61, which I've just released to CPAN. Thanks for your report. Tony
From: nikita.dedik [...] bulyon.com
Thanks a lot!!