Source:
private static Rectangle getBounds(Event event, AbstractTableOrTreeItemWrapper itemWrapper) { Scrollable tree = itemWrapper.getParent(); Rectangle treeBounds = tree.getClientArea(); Rectangle itemBounds = itemWrapper.getBounds(); int columnCount = itemWrapper.getParentColumnCount(); int left = -1; int right = -1; for (int i = 0, limit = columnCount == 0 ? 1 : columnCount; i < limit; ++i) { Image image = itemWrapper.getImage(i); if (image != null) { Rectangle imageBounds = itemWrapper.getImageBounds(i); if (left == -1) { left = imageBounds.x - TEXT_GAP; if (i > 0) { left += TEXT_GAP; } } right = imageBounds.x + imageBounds.width + TEXT_GAP; if (i > 0) { right += TEXT_GAP; } } String text = itemWrapper.getText(i); if (!text.isEmpty()) { Rectangle textBounds = itemWrapper.getTextBounds(i); if (left == -1) { left = textBounds.x - TEXT_GAP; if (i > 0) { left += TEXT_GAP; } } int textWidth = event.gc.textExtent(text).x; right = textBounds.x + textWidth + TEXT_GAP; if (i > 0) { right += TEXT_GAP; } } } Rectangle fill = new Rectangle(0, 0, 0, 0); fill.x = left; fill.y = itemBounds.y; if (!"cocoa".equals(SWT.getPlatform())) { fill.y += 1; } fill.width = right - left; fill.height = itemBounds.height - 1; if (!"cocoa".equals(SWT.getPlatform())) { fill.height -= 3; } final GC g = event.gc; if (event.index == columnCount - 1 || columnCount == 0) { int width = treeBounds.x + treeBounds.width - event.x; if (width > 0) { Region region = new Region(); g.getClipping(region); region.add(event.x, event.y, width, event.height); g.setClipping(region); region.dispose(); } } g.setAdvanced(true); return fill; }

Target:
private static Rectangle getBounds(Event event, AbstractTableOrTreeItemWrapper itemWrapper) { Scrollable tree = itemWrapper.getParent(); Rectangle treeBounds = tree.getClientArea(); Rectangle itemBounds = itemWrapper.getBounds(); int columnCount = itemWrapper.getParentColumnCount(); int limit = Math.max(1, columnCount); int left = -1; int right = -1; for (int i = 0; i < limit; ++i) { Image image = itemWrapper.getImage(i); if (image != null) { Rectangle imageBounds = itemWrapper.getImageBounds(i); if (left == -1) { left = imageBounds.x - TEXT_GAP; if (i > 0) { left += TEXT_GAP; } } right = imageBounds.x + imageBounds.width + TEXT_GAP; if (i > 0) { right += TEXT_GAP; } } String text = itemWrapper.getText(i); if (!text.isEmpty()) { Rectangle textBounds = itemWrapper.getTextBounds(i); if (left == -1) { left = textBounds.x - TEXT_GAP; if (i > 0) { left += TEXT_GAP; } } int textWidth = event.gc.textExtent(text).x; right = textBounds.x + textWidth + TEXT_GAP; if (i > 0) { right += TEXT_GAP; } } } Rectangle fill = new Rectangle(0, 0, 0, 0); fill.x = left; fill.y = itemBounds.y; if (!"cocoa".equals(SWT.getPlatform())) { fill.y += 1; } fill.width = right - left; fill.height = itemBounds.height - 1; if (!"cocoa".equals(SWT.getPlatform())) { fill.height -= 3; } final GC g = event.gc; if (event.index == columnCount - 1 || columnCount == 0) { int width = treeBounds.x + treeBounds.width - event.x; if (width > 0) { Region region = new Region(); g.getClipping(region); region.add(event.x, event.y, width, event.height); g.setClipping(region); region.dispose(); } } g.setAdvanced(true); return fill; }