On Wed, 4 Jun 2025 07:42:35 GMT, GennadiyKrivoshein <d...@openjdk.org> wrote:

>> src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java line 742:
>> 
>>> 740:     private Rectangle2D getPageFormatArea(PageFormat page, double 
>>> scaleX, double scaleY) {
>>> 741:         Rectangle2D.Double pageFormatArea;
>>> 742:         if (scaleX != 1 && scaleY != 1) {
>> 
>> BTW, Do we need this check as if scaleX=scaleY=1 then also no issue in doing 
>> multiplying with 1 ie scaleX and scaleY and if one of them is not 1 then we 
>> need to multiply anyway..so it seems this check is not needed?!!
>
> @prsadhuk  This is a little bit faster.  Calling the scale method with 1 does 
> not change the affine transform, but performs unnecessary invalidation.

I think the key point is that it should be || not && 
Including in the 3 additional cases below.
I can see a case that if either is 1 then arguably scaling in the other axis is 
not going to help much, but it looks odd.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25489#discussion_r2193399030

Reply via email to