Bug 125651 [Forms] Wrapped hyperlinks cause artifacts in FormText
There seems to be an off-by-one error in the FormText widget between images and text. See the example below and the corresponding screenshot: final FormText text = formToolkit.createFormText(parent, false/*no links so not a concern*/); text.setForeground(formColors.getColor(DataEntryFormColors.FORM_ELEMENT_FOREGROUND)); text.setBackground(formColors.getColor(DataEntryFormColors.FORM_LABEL_BACKGROUND)); text.setWhitespaceNormalized(false/*don't remove whitespace*/); text.setText("<form><p><img href=\"addNewLabel\"/> <img href=\"deleteLabel\"/>This is a really really really long line to test the wrapping of text. This is a really really really long line to test the wrapping of text. This is a really really really long line to test the wrapping of text.</p></form>", true/*parse tags*/, false/*no links so no concern*/); text.setImage("addNewLabel", addNewLabelImage); text.setImage("deleteLabel", deleteLabelImage); This widget is within a form using TableWrapLayout. (SWT 3.2M4)
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TextSegment.java
if (newFont != null)
				gc.setFont(newFont);
		}
		FontMetrics fm = gc.getFontMetrics();
		int lineHeight = fm.getHeight();
		int descent = fm.getDescent();
		if (!wrapAllowed) {
			layoutWithoutWrapping(gc, width, locator, selected, fm, lineHeight,
					descent);
		} else {
			int lineStart = 0;
			int lastLoc = 0;
			Point lineExtent = new Point(0, 0);
			computeTextFragments(gc);
			int rightEdge = width-locator.marginWidth;
			for (int i = 0; i < textFragments.length; i++) {
				TextFragment fragment = textFragments[i];
				int breakLoc = fragment.index;
				if (breakLoc == 0)
					continue;
				
				
				if ((i != 0 || locator.x > locator.getStartX() + (isSelectable() ? 1 : 0)) && locator.x + lineExtent.x + fragment.length > rightEdge) {
					
					int ly = locator.getBaseline(lineHeight - fm.getLeading());
					Rectangle br = new Rectangle(isSelectable()?
							locator.x - 1:locator.x, ly,
							isSelectable()?lineExtent.x + 1:lineExtent.x, lineHeight - descent + 3);
					areaRectangles
							.add(new AreaRectangle(br, lineStart, lastLoc));