<Swing Dev> [11][JDK-8195095]Images are not scaled correctly in JEditorPane
Krishna Addepalli
krishna.addepalli at oracle.com
Sat Mar 3 07:10:08 UTC 2018
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
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/20180302/eb6a8c85/attachment.html>
More information about the swing-dev
mailing list