<Swing Dev> [9] Review request for 8142966 Wrong cursor position in text components on HiDPI display

Alexandr Scherbatiy alexandr.scherbatiy at oracle.com
Thu May 5 05:42:37 UTC 2016


Hello,

Could you review the fix:
   bug: https://bugs.openjdk.java.net/browse/JDK-8142966
   webrev: http://cr.openjdk.java.net/~alexsch/8142966/webrev.02

   Swing uses a font rendering context which does not take the graphics 
configuration transform into account.
   This lead to the situation when text size is measured by one font 
rendering context and drawn by another. As the result the calculated 
text size can differ from the drawn text size.

   For this issue it means that a cursor position can be farther away 
from the char position.

   This is the initial fix where graphics configuration transform is 
included into the Swing font rendering context.

   There is one more issue related to the fact that glyph advances are 
calculated in dev space and then transformed to the user space. Char 
width can have fractional value in user space if dev transform is not 
identity.
   It means that Swing should be able to draw a cursor at or select a 
text from a fractional position.
   These issues will be considered in separated fixes.

  Thanks,
  Alexandr.




More information about the swing-dev mailing list