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.

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

Commit messages:
 - 8345618: javax/swing/text/Caret/8163124/CaretFloatingPointAPITest.java 
leaves Caret is not complete

Changes: https://git.openjdk.org/jdk/pull/23129/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23129&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8345618
  Stats: 7 lines in 1 file changed: 4 ins; 2 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/23129.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23129/head:pull/23129

PR: https://git.openjdk.org/jdk/pull/23129

Reply via email to