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

Bug 329295

Summary: [painting] Painting problems with mark occurrences highlighting
Product: [Eclipse Project] Platform Reporter: John Arthorne <john.arthorne>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert, deepakazad, eclipse.felipe, markus.kell.r, remy.suen
Version: 3.7   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screen shot
none
Mark occurrence preference settings
none
patch
none
horizontal cheese
none
patch none

Description John Arthorne CLA 2010-11-02 16:00:03 EDT
Build: 3.7 M3

I am occasionally (at least once a day) seeing problems with the painting of mark occurrences in the Java editor. The general steps are:

- Select a field
- Scroll the editor quickly to view occurrences
- Painting of the occurrences is messed up. The highlighting appears within the correct bounds for the reference, but is blurred or drawn in the wrong place.

I can't consistently reproduce, and any change such as highlighting with the mouse or scrolling the editor to force a paint causes the problem to go away.
Comment 1 John Arthorne CLA 2010-11-02 16:00:30 EDT
Created attachment 182246 [details]
Screen shot
Comment 2 John Arthorne CLA 2010-11-02 16:07:32 EDT
Created attachment 182247 [details]
Mark occurrence preference settings
Comment 3 John Arthorne CLA 2010-11-02 16:09:50 EDT
I can actually reproduce this quite easily with the steps outlined above:

- Select a field in a class with multiple pages of content
- Scroll down by dragging the scrollbar until the field appears. Scrolling fast or slow doesn't matter. In fact it looks even worse when you scroll to it closer.
Comment 4 Dani Megert CLA 2010-11-03 03:25:54 EDT
I'll take a look...
Comment 5 Dani Megert CLA 2010-11-03 05:35:50 EDT
This looks like an SWT bug when (re-)drawing TextStyle.borderStyle.

I could easier reproduce by:
1. open a class (e.g. StyledText)
2. scroll down via scroll bar thumb
3. select a variable that appears often in the method
4. scroll up, so that they disappear
5. scroll down again
==> cheese
Comment 6 Dani Megert CLA 2010-11-03 05:44:49 EDT
This is a major regression introduced in 3.7 M3.

Very simple steps:
1. paste the snippet listed below
2. select the method declaration in the editor
3. scroll (it doesn't matter whether via mouse wheel, scroll bar or key board, but via scroll bar it cheese is biggest)
==> cheese

--- %< ---
public class Cheese {

	void cheese() {
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
		cheese();
	}
}
--- %< ---
Comment 7 Felipe Heidrich CLA 2010-11-04 10:44:43 EDT
Created attachment 182377 [details]
patch

Naive me, introduced this bug fixing Bug 305672. It is okay to reduce the drawing rect in the width using the clip, but not for the height.
Comment 8 Felipe Heidrich CLA 2010-11-04 10:46:14 EDT
Fixed in HEAD > 2010-11-04
Please verify. Thank you
Comment 9 Markus Keller CLA 2010-11-04 14:03:27 EDT
Created attachment 182406 [details]
horizontal cheese

Solid borders are looking good now, but dashed and dotted borders still show some cheese when scrolling horizontally. I guess the horizontal clipping needs to be aligned to the length of the drawn pattern.
Comment 10 Felipe Heidrich CLA 2010-11-04 15:45:47 EDT
oh, now I remember why I started fixing bug 305672 and stopped - reducing the rect to correct phase in the dot/dash pattern is not fun.
Lets try again.
Comment 11 Felipe Heidrich CLA 2010-11-04 16:03:02 EDT
Created attachment 182422 [details]
patch
Comment 12 Felipe Heidrich CLA 2010-11-04 16:03:49 EDT
Fixed in HEAD > 2010-NOV-04
Comment 13 Markus Keller CLA 2010-11-05 10:00:33 EDT
Thanks, verified in HEAD.