RFR: 8345618: javax/swing/text/Caret/8163124/CaretFloatingPointAPITest.java leaves Caret is not complete

Alisen Chung achung at openjdk.org
Wed Jan 15 22:37:34 UTC 2025


On Wed, 15 Jan 2025 09:45:33 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> This manual test draws a "custom" Caret which is to be placed in the same position between characters but it is seen the movement of caret leaves artifacts. Custom caret is rendering 2 horizontal and 1 vertical line to render "capital I" but horizontal lines repainting is not done properly.
> If the test is made to use Swing DefaultCaret implementation, no artifacts is seen. Since the test is about placing of caret at same position between characters, a plain vertical caret is sufficient to test so removed the horizontal line rendering.  Also, added 1 extra pixel in repainting logic to tackle caretWidth,height.
> Tested against windows, linux and mac where it renders ok and movement of caret does not leave any artifacts.

Test changes look fine, but do you know the reason why the CustomCaret was leaving artifacts?

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

PR Review: https://git.openjdk.org/jdk/pull/23129#pullrequestreview-2554182406


More information about the client-libs-dev mailing list