Bug 79542

Summary: A bug in Thumbnail.ThumbnailUpdater
Product: [Tools] GEF Reporter: Milos Volauf <mvo>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact: Alexander Nyßen <nyssen>
Severity: normal    
Priority: P3 CC: ahunter.eclipse, nyssen
Version: 3.0Keywords: bugday
Target Milestone: 4.0.0 / 3.11.0 (Neon) M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Thumbnail bug demo
none
Patch proposal (Thumbnail.java)
none
BrokenThumbnailExample
none
Thumbnails updater now checks to see whether the source figure is moving before it tries to repaint it none

Description Milos Volauf CLA 2004-11-26 05:07:39 EST
There is a bug in ThumbnailUpdater.
It occurs when the source figure is moving.
in Thumbnail.ThumbnailUpdater.start() the thumbnailGraphics is translated:
		thumbnailGraphics.translate(sourceFigure.getBounds().getLocation().negate());

There is silently assumed that source figure is not moving.
But is the source figure is moving and ThumbnailUpdater is running, the method
run() again asks for a source figure location:
org.eclipse.draw2d.geometry.Point p = sourceFigure.getBounds().getLocation();
and this can be different.

I recommend to delete a line that translates thumbnailGraphics in the method
start() and add it into a method run().
I will attach an example where we can see the effect of this bug and also my
proposal - code change.
Comment 1 Milos Volauf CLA 2004-11-26 05:09:50 EST
Created attachment 16160 [details]
Thumbnail bug demo

A test code.
Comment 2 Milos Volauf CLA 2004-11-26 05:17:00 EST
Created attachment 16161 [details]
Patch proposal (Thumbnail.java)

A proposed patch.
Changes in the code are marked by a tag:
TODO 79542
Comment 3 Milos Volauf CLA 2004-11-26 05:18:43 EST
I forgot to describe how to see a bug effect in the test code:
Run the text and drag a scroll bar. The thumbnail is not redrawing correctly.
Comment 4 Anthony Hunter CLA 2007-11-16 10:11:46 EST
Created attachment 83071 [details]
BrokenThumbnailExample

I took the code from the provided demo and patched it into the ThumbNailExample in draw2d examples. I can confirm that the text is missing from the thumbnail. Interesting that if we add 5 sets of figures (i = 5) the text appears in the thumbnail. Other values (i = 10) cause the text to not be in the thumbnail.

The provided patch does not fix the issue, so I have obsoleted it.
Comment 5 Brendan Curran-Johnson CLA 2009-01-27 16:56:05 EST
Created attachment 123955 [details]
Thumbnails updater now checks to see whether the source figure is moving before it tries to repaint it
Comment 6 Alexander Nyßen CLA 2011-10-17 14:30:45 EDT
Reassigned back to gef-inbox, also resetting target milestone, which has long passed.
Comment 7 Alexander Nyßen CLA 2015-09-17 15:04:49 EDT
With the changes applied in bug #309912 and bug #477750 this seems to have been resolved as well. Resolving as fixed in 3.11.0 M2.