<Swing Dev> [11][JDK-8195095]Images are not scaled correctly in JEditorPane

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Sat Mar 3 07:36:13 UTC 2018


looks good to me.

Only thing, in test, JFrame creation also needs to be in EDT.

Regards
Prasanta
On 3/3/2018 12:40 PM, Krishna Addepalli wrote:
>
> Hi All,
>
> Please review a fix for JDK-8195095: 
> https://bugs.openjdk.java.net/browse/JDK-8195095
>
> Webrev: http://cr.openjdk.java.net/~kaddepalli/8195095/webrev00 
> <http://cr.openjdk.java.net/%7Ekaddepalli/8195095/webrev00>
>
> Problem: When a text html is specified with an image, omitting either 
> the height/width parameter, JEditorPane scales it to default value of 
> the missing parameter, whereas it should fetch the actual value from 
> the image.
>
> Fix: The problem is in ImageView.java. In the imageUpdate function, in 
> the resizing logic the “changed” flag is set to 1 if height is 
> present, and to 2 if width is present. But while updating the width, 
> the check is swapped, i.e width is set if flag is 1 and vice versa.
>
> PS: The webrev contains a new “circle.png” file, so when you import 
> the patch, you may need to manually copy the file, since “hg import” 
> doesnot automatically import the .png files from the patch file.
>
> Thanks
>
> Krishna
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20180303/a1a49a1b/attachment.html>


More information about the swing-dev mailing list