Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326905 - [painting] White space wrongly rendered after horizontal scrolling
Summary: [painting] White space wrongly rendered after horizontal scrolling
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M3   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-04 07:05 EDT by Markus Keller CLA
Modified: 2010-10-07 09:58 EDT (History)
1 user (show)

See Also:
markus.kell.r: review+


Attachments
fix (3.01 KB, patch)
2010-10-07 00:18 EDT, Deepak Azad CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-10-04 07:05:56 EDT
N20101003-2000

White space is sometimes wrongly rendered after horizontal scrolling in the editor.

Checked options in prefs: Leading spaces, trailing spaces & tabs.
Rest unchecked.

When I now open a file that contains lines with leading tabs (e.g. a .project file), make the editor narrow such that the horizontal scroll bar appears, and then scroll horizontally, then leading tabs are sometimes also rendered.

If you scroll very quickly, it sometimes renders correctly.
Comment 1 Markus Keller CLA 2010-10-04 08:20:36 EDT
With the same options, I also see spaces painted when I have a sequence of multiple "enclosed" spaces (e.g. "int          foo= 1;" and then select one or more of these spaces. Single spaces are OK.
Comment 2 Deepak Azad CLA 2010-10-07 00:18:11 EDT
Created attachment 180383 [details]
fix

As correctly pointed out by Markus, the problem was that the whole line is not always painted, and as a result the computation of textBegin and textEnd was wrong.
Comment 3 Deepak Azad CLA 2010-10-07 00:20:36 EDT
Markus, please commit the patch if it looks good to you.
Comment 4 Markus Keller CLA 2010-10-07 09:58:20 EDT
Thanks, looks good and works fine, committed to HEAD.

The fix adds a second call to StyledTextContent#getTextRange(int, int) that copies the char[] twice (if I remember correctly...). This can be improved with bug 326419.