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

Bug 340603

Summary: Selection under cocoa draws wrong in wrapped TextLayout
Product: [Eclipse Project] Platform Reporter: Hugo Corbucci <nightao>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 4.1   
Target Milestone: 3.7 M7   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Java example code.
none
screen shot of the results produced by the example code.
none
proposed patch to fix the problem none

Description Hugo Corbucci CLA 2011-03-21 15:29:06 EDT
Build Identifier: I20100608-0911

Using SWT cocoa, a TextLayout with wrapped text where the first line is smaller than the others, the selection is drawn as a box with the width of the first line. This causes text on the other lines to leak out of the selection background box.
The attached screen shot shows the result of the attached java code with the selection bug.

Reproducible: Always

Steps to Reproduce:
Run the attached Test.java under mac os x with cocoa window system.
Comment 1 Hugo Corbucci CLA 2011-03-21 15:30:27 EDT
Created attachment 191638 [details]
Java example code.
Comment 2 Hugo Corbucci CLA 2011-03-21 15:31:15 EDT
Created attachment 191639 [details]
screen shot of the results produced by the example code.
Comment 3 Hugo Corbucci CLA 2011-03-21 16:35:50 EDT
Created attachment 191644 [details]
proposed patch to fix the problem

This patch proposes a solution that uses the widest line as the width of the selection rectangle.
Comment 4 Silenio Quarti CLA 2011-03-22 11:16:21 EDT
Fixed in HEAD