Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 529087

Summary: [code mining] Improve draw of line content annotation.
Product: [Eclipse Project] Platform Reporter: Angelo ZERR <azerr>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, gautier.desaintmartinlacaze, Lars.Vogel, mistria
Version: 4.8   
Target Milestone: 4.8 M5   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/114596
https://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=ae1808bedf9b19c2eeb02600f58c48787041a1d3
Whiteboard:
Bug Depends on:    
Bug Blocks: 528418, 529011    
Attachments:
Description Flags
Demo with parameter name with bug
none
Demo with parameter name with fix none

Description Angelo ZERR CLA 2017-12-21 09:01:14 EST
I have updated the inlined annotation demo to draw "red", "green", "blue" before rgb declaration to try to support https://bugs.eclipse.org/bugs/show_bug.cgi?id=529011 and the result is very bad (see attached demo):

 * text is not well aligned.
 * the "2" character of teh first 255 is gray although it should be black.
 * sometimes when you remove content, application crashes (see demo at the end).

The issue is to fix alignement but too improve teh compute of width to avoid doing new GC each time. The idea is to update the GlyphMetrics#width when annotation is drawn (gc is available in this case) and not before the draw.

A new patch will come soon.
Comment 1 Angelo ZERR CLA 2017-12-21 09:02:20 EST
Created attachment 272010 [details]
Demo with parameter name with bug
Comment 2 Eclipse Genie CLA 2017-12-21 09:32:38 EST
New Gerrit change created: https://git.eclipse.org/r/114596
Comment 3 Angelo ZERR CLA 2017-12-21 09:35:48 EST
Created attachment 272011 [details]
Demo with parameter name with fix

Here a demo with my gerrit patch https://git.eclipse.org/r/114596
Comment 4 Lars Vogel CLA 2017-12-21 10:07:06 EST
(In reply to Angelo ZERR from comment #3)
> Created attachment 272011 [details]
> Demo with parameter name with fix
> 
> Here a demo with my gerrit patch https://git.eclipse.org/r/114596

Impressive
Comment 6 Angelo ZERR CLA 2018-01-22 09:11:27 EST
Thanks @Mickael for the merge.