Community
Participate
Working Groups
I would like to see the option to remove the (hardcoded) margin of 2 pixels. I need this as I'm rendering a StyledText *over* another StyledText. A simple setMargin(int marginX, int marginY) would do it for me. As a workaround, I'm currently using a Composite to clip off the margin.
I'm not sure what you're saying here. We are rendering on a canvas at x=0 on non-bidi platforms. On a bidi platform we have a margin to account for the bidi cursor. If you get rid of this margin, the bidi cursor will be clipped. Exactly where are you seeing these two pixels? I'm not sure why this really matters either. Exactly what are you trying to do?
I'm not using bidi. The 2 pixel border I see on the right and on the bottom of the widget. Run the application and select everything in the StyledText. You will see a two pixel thichk red line remaining. Actually, there are very likely more pixels on the right because of the font-width bug (4664). What I'm trying to do is to render a styled text exactly on top of a line of another styled text. The two pixel margin overlaps with the next line, which is not what I want. ---8<--- package bugs; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class StyledTextBug { public static void main(String arguments[]) { Display display= new Display(); Shell shell= new Shell(); StyledText text= new StyledText(shell, SWT.NONE); text.setText ("fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"); text.setBackground(display.getSystemColor(SWT.COLOR_RED)); shell.setLayout(new FillLayout()); shell.pack(); shell.open(); while (!shell.isDisposed()) if (!display.readAndDispatch()) display.sleep(); } }
computeSize problem. No need to add API for specifying margins.