| Summary: | Rendering/Scroll issue with vertical indent | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Mickael Istria <mistria> |
| Component: | SWT | Assignee: | Mickael Istria <mistria> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | CC: | ericwill |
| Version: | 4.19 | ||
| Target Milestone: | 4.19 M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/174599 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=44d171c4d147e7c175dcc3a3fdea966dc7c5de44 https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/174709 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=da8340bb75569958e631ae94641994c1804c8d69 |
||
| Whiteboard: | |||
| Bug Depends on: | 570342 | ||
| Bug Blocks: | |||
|
Description
Mickael Istria
I can reproduce it with plain SWT:
public class Snippet378 {
private static final int LINES = 50;
private static final int WORDS_PER_LINE = 10;
private static final String WORD = "123456789 ";
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10, 10, 300, 300);
shell.setLayout(new FillLayout());
final StyledText text = new StyledText(shell, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
StringBuilder buffer = new StringBuilder(LINES * WORDS_PER_LINE * WORD.length() * 2);
for (int i = 0; i < LINES ; i++) {
buffer.append("Line " + i + ": ");
for (int j = 0; j < WORDS_PER_LINE; j++) {
buffer.append(WORD);
}
buffer.append("\n");
}
shell.open();
text.setText(buffer.toString());
text.addCaretListener(e -> {
if (text.getCaretOffset() > 100) {
text.setLineVerticalIndent(1, 25);
}
});
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
Just scroll down, click on any character (with offset > 100), then try to scroll up => some text is not accessible any more. Resizing seems to help.
I have this issue reproduced into a SWT unit test. It's related to topIndex not being update so scrolling up scrolls above expected area. New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/174599 Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/174599 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=44d171c4d147e7c175dcc3a3fdea966dc7c5de44 Some part of the issue is still present despite previous change. It seems related to scrollbars not being properly updates in some cases, and then able to scroll above 1st line, cascading to many issues. New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/174709 Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/174709 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=da8340bb75569958e631ae94641994c1804c8d69 I'm marking is as resolved as last known issue (bug 570342) seems fixed. Anyone feel free to reopen if further issues are identified. *** Bug 542107 has been marked as a duplicate of this bug. *** |