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

Bug 152028

Summary: Graphics.drawTextLayout translates the string location multiple times, but only sometimes.
Product: [Tools] GEF Reporter: Andy Adamczak <aadamczak>
Component: GEF-Legacy Draw2dAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: ahunter.eclipse
Version: 3.2   
Target Milestone: 3.4.0 (Ganymede) M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The good image showing how the figure should look
none
The bad image showing the drawTextLayout corruption when the figure is moved. none

Description Andy Adamczak CLA 2006-07-27 13:22:14 EDT
We just moved our project from Eclipse and Gef 3.1 to 3.2, and we started seeing corruption in our gef based editors.  We are using custom drawn figures for our editors.  Basically any strings that are drawn using the Graphics.drawTextLayout function get translated multiple times.  I did some experimentation with this issue.  If I change to use the Graphics.drawString function, the text gets displayed correctly at all times.  If I use Graphics.drawTextLayout, if the whole display is invalidated and redrawn, the text is displayed correctly.  If only a section of the screen is invalidated or redrawn (like a single figure, for example), the text in the invalidated area gets translated multiple times.  I am going to include two images.  One is a good image showing how the editing figure should look (and how it used to look in 3.1 even if moved, resized, etc).  The bad image shows the text output corruption.  Note that at the bottom is a small, cyan graph.  Note that the text in the graph (the left and right range values) did not get corrupted because they use the drawString call.  Note that the other text is corrupted because it uses the drawTextLayout call.

I need to use the drawTextLayout call because I need better control over wrapping and line breaks in the figures.
Comment 1 Andy Adamczak CLA 2006-07-27 13:24:59 EDT
Created attachment 46896 [details]
The good image showing how the figure should look

This image shows how the figure used to look in GEF 3.1 even if resized, moved, etc.  It also shows how the figure looks in GEF 3.2 when the whole screen is invalidated.
Comment 2 Andy Adamczak CLA 2006-07-27 13:27:49 EDT
Created attachment 46899 [details]
The bad image showing the drawTextLayout corruption when the figure is moved.

This image shows how the figure gets corrupted in GEF 3.2 when moved.  Once it's moved, the corruption stays until the whole screen gets invalidated.  Then the figure looks good again, until only a section of the screen is repainted.
Comment 3 Randy Hudson CLA 2006-08-14 11:20:53 EDT
Please provide a test case or something we can debug.
Comment 4 Randy Hudson CLA 2006-08-14 11:36:14 EDT
see bug 128200.
Comment 5 Anthony Hunter CLA 2007-08-14 11:45:45 EDT
bug 128200 is resolved, so marking this bug as fixed as well.