Project: SWT
Bug 149576 [DnD] StyledText auto-scroll does not work if first line is empty
Reported: 2006-07-04 09:47:35 | Status: resolved fixed

If the first line of the StyledText content is empty, auto-scrolling does not work. Debugging showed that StyledTextDragAndDropEffect computes the potential scroll amount (the extent of a char) using StyledText.getTextBounds(0, 0) which yields a zero extent in case of an empty first line. Can be easily replicated with a slightly modified version of SWT snippet 210 (using DND.FEEDBACK_SCROLL).

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextDropTargetEffect.java