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

Bug 212319

Summary: TextFlow doesn't paint a border properly
Product: [Tools] GEF Reporter: Pratik Shah <ppshah>
Component: GEF-Legacy Draw2dAssignee: Pratik Shah <ppshah>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: hudsonr
Version: 3.4   
Target Milestone: 3.4.0 (Ganymede) M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for the project none

Description Pratik Shah CLA 2007-12-07 23:43:18 EST
It sizes out its border fragments properly, but inherits behaviour from InlineFlow which doesn't pass the right size to the FlowBorder's paint method.

Also, TextFlow doesn't restoreState() in its paintSelection() method (which is called from paintBorder()).
Comment 1 Pratik Shah CLA 2008-01-09 13:32:38 EST
Created attachment 86492 [details]
Patch for the project

Patch for the fix in InlineFlow
Comment 2 Pratik Shah CLA 2008-01-14 16:53:36 EST
In the patch above, I've removed the lines that were preventing the TextFlow's border from being displayed properly.  I'm not sure what the purpose of those lines of code was.  But since FlowBorders don't work for InlineFlows anyway (see bug 215266), it shouldn't matter.

The patch has been committed to head.  Marking as fixed.
Comment 3 Randy Hudson CLA 2008-01-15 10:17:41 EST
Pratik, the call to restoreState() seems superfluous. paintSelection() does this already if called. and Figure.paint() already calls pop() right after paintBorder().
Comment 4 Pratik Shah CLA 2008-01-15 11:28:58 EST
TextFlow overrides paintSelection() and doesnt call restoreState().  So, I thought it would be better placed in paintBorder() before it calls paintSelection().
Comment 5 Randy Hudson CLA 2008-01-15 14:43:20 EST
Maybe we could add it to TextFlow#paintSelection too then.  It's just a bunch of fields getting assigned, but it doesn't hurt to avoid doing it twice :-P.
Comment 6 Pratik Shah CLA 2008-01-15 16:14:14 EST
Well, then maybe we should avoid doing it even once when we can.  When there's no border, there's no need to restoreState() at all. I can remove restoreState() from InlineFlow#paintSelection() :-P