Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » StyledText: wrong style length in PaintObjectEvent
StyledText: wrong style length in PaintObjectEvent [message #523117] Thu, 25 March 2010 08:16 Go to next message
Franck Mising name is currently offline Franck Mising nameFriend
Messages: 92
Registered: July 2009
Location: France
Member
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!
Re: StyledText: wrong style length in PaintObjectEvent [message #523817 is a reply to message #523117] Mon, 29 March 2010 13:46 Go to previous messageGo to next message
Felipe Heidrich is currently offline Felipe HeidrichFriend
Messages: 29
Registered: July 2009
Junior Member
You are right, we are missing a + 1 there.
Please enter the bug.


Thank you
Felipe
Re: StyledText: wrong style length in PaintObjectEvent [message #524241 is a reply to message #523817] Wed, 31 March 2010 10:05 Go to previous message
Franck Mising name is currently offline Franck Mising nameFriend
Messages: 92
Registered: July 2009
Location: France
Member
Felipe Heidrich wrote on Mon, 29 March 2010 09:46
You are right, we are missing a + 1 there.
Please enter the bug.


Thank you
Felipe


Thanks, I filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=307681
Previous Topic:How to contribute to the default cut|copy/paste StyledText commands
Next Topic:How do I find the Install Unit (IU) for a particular plug-in?
Goto Forum:
  


Current Time: Sat Jun 15 22:04:37 GMT 2024

Powered by FUDForum. Page generated in 0.03294 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top