Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [GEF3] Help needed to fix Thumbnail on Mac Mojave
[GEF3] Help needed to fix Thumbnail on Mac Mojave [message #1801460] Sun, 20 January 2019 10:05 Go to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
We use a ScrollableThumbnail in an outline view in our RCP app. However, on Mac Mojave it does not display correctly as described here - https://github.com/archimatetool/archi/issues/401

I appreciate that the GEF3 code is no longer maintained so all I am asking is for a hint on what might cause this issue so that I might try to patch the GEF/Draw2D code for a fix.

Thanks in advance if anyone can help or point me in the right direction.
Re: [GEF3] Help needed to fix Thumbnail on Mac Mojave [message #1801461 is a reply to message #1801460] Sun, 20 January 2019 11:49 Go to previous messageGo to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
I narrowed the problem area down to org.eclipse.draw2d.parts.Thumbnail and the ThumbnailUpdater inner class.

If I set MAX_NUMBER_OF_TILES to 1 instead of 16 it fixes the problem. But I don't know why this should be so and whether the issue is related to Mac Mojave.

Any help would be greatly appreciated.

[Updated on: Thu, 24 January 2019 11:24]

Report message to a moderator

Re: [GEF3] Help needed to fix Thumbnail on Mac Mojave [message #1801664 is a reply to message #1801461] Thu, 24 January 2019 11:23 Go to previous messageGo to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
It may be related to and old bug - https://bugs.eclipse.org/bugs/show_bug.cgi?id=309912

Can anyone help?
Re: [GEF3] Help needed to fix Thumbnail on Mac Mojave [message #1801686 is a reply to message #1801664] Thu, 24 January 2019 17:23 Go to previous message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
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();
Previous Topic:Connection: how to update control points
Next Topic:Hover outline is having gap on right+bottom side
Goto Forum:
  


Current Time: Thu Oct 28 12:14:43 GMT 2021

Powered by FUDForum. Page generated in 0.02087 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top