[8] Review request for 8016833: Underlines and strikethrough not rendering correctly (original) (raw)
anton nashatyrev anton.nashatyrev at oracle.com
Thu Jun 20 10:41:35 UTC 2013
- Previous message: [8] Review request for CR 8006087 [TEST_BUG] The BACKSPACE key doesn't work and after pressing 'cancel' and 'DONE' button, the case pass automatically.
- Next message: [8] Review request for 8016833: Underlines and strikethrough not rendering correctly
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello, could you please review the following fix:
fix: http://cr.openjdk.java.net/~vkarnauk/8016833/jdk8/webrev.00/ <http://cr.openjdk.java.net/%7Evkarnauk/8016833/jdk8/webrev.00/> bug: http://bugs.sun.com/view_bug.do?bug_id=8016833
The reason of such behavior is that the superscripted GlyphView requested increased vertical span, since the alignment of value 1.0 (GlyphView.getAligment(View.Y_AXIS) returns 1.0) isn't enough to paint it as high as required. (BTW, for subscripted text setting the alignment is enough)
GlyphView.paintTextUsingColor() calculates the Y position of the underscore as following:
int y = alloc.y + alloc.height - (int) painter.getDescent(this);
but here alloc.height means the space reserved for glyphs and not the actual boundary of the painted text. To fix that we need to substitute alloc.height with painter.getHeight(this).
The fix looks safe since the GlyphView preferred vertical span is initially requested from the GlyphPainter.
Thanks! Anton.
- Previous message: [8] Review request for CR 8006087 [TEST_BUG] The BACKSPACE key doesn't work and after pressing 'cancel' and 'DONE' button, the case pass automatically.
- Next message: [8] Review request for 8016833: Underlines and strikethrough not rendering correctly
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]