RFR: 8345618: javax/swing/text/Caret/8163124/CaretFloatingPointAPITest.java leaves Caret is not complete
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Jan 16 03:22:35 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.
Usually caret are normally vertical lines so "damage" routine repaints caret based on that as caret width will be of 1-2 pixel wide but this custom caret also draws 2 horizontal lines on top and below of vertical but "damage" does not take care of that, it seems.
Also, since the test is about caret placement and not caret shape, even Swing DefaultCaret would have sufficed but I have retained its CustomCaret usgae but removed the problematic horizontal line rendering..
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23129#issuecomment-2594394753
More information about the client-libs-dev
mailing list