RFR: 8344637: Fix Page8 of manual test java/awt/print/PrinterJob/PrintTextTest.java on Linux and Windows [v7]
Harshitha Onkar
honkar at openjdk.org
Fri Dec 6 23:59:53 UTC 2024
On Fri, 29 Nov 2024 18:12:06 GMT, Daniel Gredler <dgredler at openjdk.org> wrote:
>> src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java line 873:
>>
>>> 871: AffineTransform.getScaleInstance(scaleFactorX, scaleFactorY);
>>> 872: advanceTransform.rotate(devangle); // radians
>>> 873: advanceTransform.rotate(iangle * Math.PI / 1800.0); // 1/10 degrees -> radians
>>
>> Fix to WPathGraphics.java is a little more intricate and certainly requires a more expert review from @prrace.
>> Was devangle fix added for the landscape issue observed on Pg#8 ?
>>
>> A earlier comment mentions that device space rotation must not be added.
>>
>>
>> GDI advances must not include device space rotation.
>> See earlier comment in printGlyphVector() for details.
>
> The two angles (`iangle` + `devangle`) need to be used to fix the Windows page 8 printed "GlyphVector with position adjustments" test case, here's what it looks like without these rotation angles (left side is printed and incorrect, right side is not printed and is correct):
>
> 
>
> Adding `iangle` alone looks OK in the printed portrait page, but not in the printed landscape page (`devangle` is zero and therefore makes no difference when printing in portrait mode, but not so for landscape mode).
>
> This restores the rotation transformation that was being applied prior to commit 5c2672351683467fdeeda7796d971634fc3c51ae (prior to this commit the advance transform was a copy of the device transform, with the extra `iangle` rotation applied, meaning that both the device rotation and the `iangle` rotation were included).
Thanks for including the details. Sounds reasonable.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21980#discussion_r1874151081
More information about the client-libs-dev
mailing list