|
|
|
Re: [GEF3] Help needed to fix Thumbnail on Mac Mojave [message #1801686 is a reply to message #1801664] |
Thu, 24 January 2019 12:23  |
Eclipse User |
|
|
|
It gets interesting and actually is to do with SWT and GC.drawGraphics().
In the Thumbnail$ThumbnailUpdater class an image tile is drawn:
// Copy the painted tile image into the thumbnail image.
thumbnailGC.drawImage(tileImage, 0, 0, sx2 - sx1, sy2 - sy1, sx1,
sy1, sx2 - sx1, sy2 - sy1);
However, even though tileImage contains the correct image before the drawImage() call it contains the first tile image after it is called. It is as if something in SWT is caching the first image and replacing it..
I've managed to boil this down to a Snippet and raised a bug - https://bugs.eclipse.org/bugs/show_bug.cgi?id=543796
If, however, we make a copy of tileImage it works:
// Don't re-use the same tileImage
Image tmp = new Image(tileImage.getDevice(), tileImage.getImageData());
// Copy the painted tile image into the thumbnail image.
thumbnailGC.drawImage(tmp, 0, 0, sx2 - sx1, sy2 - sy1, sx1,
sy1, sx2 - sx1, sy2 - sy1);
tmp.dispose();
|
|
|
Powered by
FUDForum. Page generated in 0.10007 seconds