Community
Participate
Working Groups
Build Identifier: SWT x86-3.6.1.v3665c Issue occurs when using DefaultGalleryGroupRenderer and a line of items is scrolled so that the upper or lower edge is at or just outside upper/lower edge of widget area. Then scroll in the direction where the item edge is close to clientarea, eg. up. The item is moved down bu the very top of the item is not redrawn probably. The error lies somewhere in interaction with AbstractGridGroupRenderer.getVisibleItems() called from DefaultGalleryGroupRenderer.draw(). When computing first and last item in clip area, getVisibleItems() subtracts minMargin between group header and first item like so: int lastLine = (clipY - y - offset + clipHeight - minMargin) / (itemHeight + minMargin); However, "offset" above has been already accounted for on the ouside through DefaultGalleryGroupRenderer.getGroupOffset() protected int getGroupOffset(GalleryItem item) { if (item.getParentItem() != null) { return 0; } return getGroupHeight(item) + minMargin; } So minMargin between group header and first line is counted twice and this messes up redrawing when an item is at the edge. One will probably not notice this when showing plain images but I had custom paint listener that rendered a border around images. Fix for this case seems to be to do int[] indexes = getVisibleItems(group, x, y, clipX, clipY, clipWidth, clipHeight, groupOffset - minMargin); in DefaultGalleryGroupRenderer.draw(). BUT I am not sure whether it should really be fixed in getVisibleItems() instead. That could in turn break NoGroupRenderer and 3rdparty subclasses of AbstractGridGroupRenderer. I am not trying to make a generic fix since I'm not sure whether first margin is supposed to be part of group offset or not. Reproducible: Sometimes Steps to Reproduce: 1.In attached app, scroll an stop up or down, or use arrows 2.Look for items not properly redrawn when scrolled out 3. Might take a few attempts since it occurs only when items overlap a few pixels with clientarea edge.
Created attachment 189897 [details] Test application to reproduce
This bug does not have a target milestone assigned and is automatically closed as part of the 2.3.0 release cleanup. It could be that this bug is accidentally closed for which we apologize. If this bug is still relevant, please re-open and set a target milestone.