On Mon, 11 Mar 2024 10:05:41 GMT, Tejesh R <t...@openjdk.org> wrote:

> Fix suggested in bug 
> [8210807](https://github.com/openjdk/jdk/commit/38bbbe7588c94d3a0edd1c120ba49cbd0851a720)
>  had a regression in Nimbus L&F yet it resolved the issue in other L&F. The 
> better approach would be to handle `MultiResolutionImages `in `PathGraphics` 
> class `getBufferedImage` method and is suggested here. The fix doesn't cause 
> any regression and is verified in CI system. The test 
> javax/swing/JTable/JTableScrollPrintTest.java is verified for all platforms 
> and all L&F (Except in Windows it doesn't work due an issue introduced in 22, 
> yet to investigate on it). And also fix 
> [8210807](https://github.com/openjdk/jdk/commit/38bbbe7588c94d3a0edd1c120ba49cbd0851a720)
>  has been reverted, retaining the test.

src/java.desktop/share/classes/sun/print/PathGraphics.java line 1151:

> 1149:     public static BufferedImage 
> convertToBufferedImage(MultiResolutionImage multiResolutionImage,
> 1150:                                                        double width, 
> double height ) {
> 1151:         Image resolutionImage = 
> multiResolutionImage.getResolutionVariant(width,height);

Suggestion:

        Image resolutionImage = 
multiResolutionImage.getResolutionVariant(width, height);

src/java.desktop/share/classes/sun/print/PathGraphics.java line 1156:

> 1154:                                                         
> BufferedImage.TYPE_INT_ARGB);
> 1155:         Graphics2D g2d = bufferedImage.createGraphics();
> 1156:         g2d.drawImage(resolutionImage, 0, 0, (int)width, 
> (int)height,null);

Suggestion:

        g2d.drawImage(resolutionImage, 0, 0, (int)width, (int)height, null);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18187#discussion_r1527166774
PR Review Comment: https://git.openjdk.org/jdk/pull/18187#discussion_r1527166756

Reply via email to