Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340603 - Selection under cocoa draws wrong in wrapped TextLayout
Summary: Selection under cocoa draws wrong in wrapped TextLayout
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.1   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-21 15:29 EDT by Hugo Corbucci CLA
Modified: 2011-04-26 02:57 EDT (History)
1 user (show)

See Also:


Attachments
Java example code. (1.52 KB, text/plain)
2011-03-21 15:30 EDT, Hugo Corbucci CLA
no flags Details
screen shot of the results produced by the example code. (31.28 KB, image/png)
2011-03-21 15:31 EDT, Hugo Corbucci CLA
no flags Details
proposed patch to fix the problem (792 bytes, patch)
2011-03-21 16:35 EDT, Hugo Corbucci CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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