Bug 79542 - A bug in Thumbnail.ThumbnailUpdater
Summary: A bug in Thumbnail.ThumbnailUpdater
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.0.0 / 3.11.0 (Neon) M2   Edit
Assignee: gef-inbox CLA
QA Contact: Alexander Nyßen CLA
URL:
Whiteboard:
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2004-11-26 05:07 EST by Milos Volauf CLA
Modified: 2015-09-17 15:04 EDT (History)
2 users (show)

See Also:


Attachments
Thumbnail bug demo (2.27 KB, text/plain)
2004-11-26 05:09 EST, Milos Volauf CLA
no flags Details
Patch proposal (Thumbnail.java) (13.37 KB, patch)
2004-11-26 05:17 EST, Milos Volauf CLA
no flags Details | Diff
BrokenThumbnailExample (3.11 KB, application/octet-stream)
2007-11-16 10:11 EST, Anthony Hunter CLA
no flags Details
Thumbnails updater now checks to see whether the source figure is moving before it tries to repaint it (2.89 KB, patch)
2009-01-27 16:56 EST, Brendan Curran-Johnson CLA
no flags Details | Diff

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