[OpenJDK 2D-Dev] Pixel-perfect drawing on JPanel

Michał Błaszak mibl at stibosystems.com
Thu Dec 20 11:11:53 UTC 2018


Hi All,

I hope this is a known problem but just in case it's not.

Trying to make an app drawing something on JPanel I noticed some annoying inaccuracies.

The attached piece of code is supposed to draw a series of lines one below the other (swapping colors are to demonstrate what's happening).
The result is presented in the following picture:
[cid:image003.jpg at 01D4985D.2FD2C670]

That means that some pixels are unreachable.

I tested it on several jdk releases. Results are:
OpenJDK Runtime Environment (build 1.8.0_40-b25): Works correctly
OpenJDK Runtime Environment (build 9+181): Wrong behavior
OpenJDK Runtime Environment 18.3 (build 10.0.2+13): Wrong behavior
OpenJDK Runtime Environment 18.9 (build 11.0.1+13): Wrong behavior

The same inaccuracies are observable when using drawRect() or fillRect().

I wanted to report is a bug but I do not know how to do it.
Thank you for looking at it.

Best regards

Michał Błaszak
Section Manager, Research & Development

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/2d-dev/attachments/20181220/451960f9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 19047 bytes
Desc: image003.jpg
URL: <https://mail.openjdk.java.net/pipermail/2d-dev/attachments/20181220/451960f9/image003-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.java
Type: application/octet-stream
Size: 1355 bytes
Desc: test.java
URL: <https://mail.openjdk.java.net/pipermail/2d-dev/attachments/20181220/451960f9/test-0001.java>


More information about the 2d-dev mailing list