https://issues.apache.org/bugzilla/show_bug.cgi?id=51043

--- Comment #3 from Andreas L. Delmelle <adelme...@apache.org> 2011-04-08 
18:09:14 EDT ---
(In reply to comment #2)
> 
> A quick fix would be to only take into account differences greater than or
> equal to, say, 0.5pt.

To fix the rounding issue, was looking at fo.properties.FixedLength.convert().
There is a suspicious plain cast from double to int.

In case of the first page we get the following values in mpt: 
page-width = 210mm = 595275(.5907)
margin-left = 29mm = 82204(.72243)
margin-right = 1mm = 2834(.64567)
=> 595275 - 82204 - 2834 = 510237

For the second:
page-width = 210mm = 595275(.5907)
margin-left = 30mm = 85039(.3701)
margin-right = 0
=> 595275 - 85039 = 510236

Rounding the values would also be wrong. In this case, that would simply flip
the results. :-/

Scientists would reason:
P1 = 595275(+1) - 82204(+1) - 2834(+1) = 510237(+/-3)
P2 = 595275(+1) - 85039(+1) = 510236(+/-2)
=> P1 ~ P2, or: close enough

However, even after eliminating the difference of 1mpt, I get a
NullPointerException.
Could be my local copy, though. Will retry with a fresh trunk later...

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to