StyledText: wrong style length in PaintObjectEvent [message #523117] |
Thu, 25 March 2010 08:16  |
Eclipse User |
|
|
|
Before I file this as a bug I want to make sure I am not missing something: if I set a StyleRange with a length of 1 and a non null glyph metrics on a StyledText, I receive paint events with an event such that event.style.length = 0.
This seems to come from the way int array ranges are computed and interpreted in StyledTextRenderer vsTextLayout:
- in TextLayout.getRanges() the int[] array is said (javadoc) to contain the "start and end of each text style", and for a style with a length of 1 the array contains [..., <start>,<start>, ...].
Also the setStyle implementation shows that those offsets are inclusive.
- however in StyledTextRenderer.drawLine (end of the method when styles[i].metrics != null) the int[] array obtained from the layout is assumed to contain <start>,<start+1> since the style length is computed as
int length = ranges[(i << 1) + 1] - ranges[i << 1];
Can someone confirm that this is a bug?
Thanks!
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04109 seconds