Community
Participate
Working Groups
Assuming the current 1st line in the StyledText is partially cropped, if one switches from fixed line height (default) to variable line height (eg by enabling word wrap), then the visible area moves for no good reason. It will basically move the content so that the top line is the one that was previously just after the "partial" one. In cases where there is no layout change (eg enabling word wrap when there is nothing long enough to wrap), nothing should move, or it gives an impression of being "jumpy". This does quite visibly affect code minings as well, which use the setLineVerticalIndent() method.
Here is a test case that shows the issue @Test public void test_notFixedLineHeightDoesntChangeLinePixelIfUnnecessary() { String _50lines = IntStream.range(1, 50).mapToObj(Integer::toString).collect(Collectors.joining("\n")); text.setText(_50lines); text.setSize(500, 200); int line = 30; int offset = text.getOffsetAtLine(line); text.setSelection(offset); text.showSelection(); int firstLinePixel = text.getLinePixel(0); text.setWordWrap(true); // make non fixed line height assertEquals(firstLinePixel, text.getLinePixel(0)); // fails, window content moved by 10pixels. }
I think this is caused by topIndexY not being set to useful value in fixed line height, while variable line height expects it to be set.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/173661
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/173661 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=62873ac24d92f573108ea676aaf2559a7deaec93
(In reply to Eclipse Genie from comment #4) > Gerrit change > https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/173661 was > merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=62873ac24d92f573108ea676aaf2559a7deaec93 This caused regression in bug 569626.
Resetting target, please retarget as required.
(In reply to Andrey Loskutov from comment #5) > (In reply to Eclipse Genie from comment #4) > > Gerrit change > > https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/173661 was > > merged to [master]. > > Commit: > > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > > ?id=62873ac24d92f573108ea676aaf2559a7deaec93 > > This caused regression in bug 569626. Andrey, Can you please point to the regression bug? the above mentioned bug is current bug. Removing the target now. Please retarget if necessary
(In reply to Sravan Kumar Lakkimsetti from comment #7) > (In reply to Andrey Loskutov from comment #5) > > (In reply to Eclipse Genie from comment #4) > > > Gerrit change > > > https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/173661 was > > > merged to [master]. > > > Commit: > > > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > > > ?id=62873ac24d92f573108ea676aaf2559a7deaec93 > > > > This caused regression in bug 569626. > > Andrey, > > Can you please point to the regression bug? the above mentioned bug is > current bug. > > Removing the target now. Please retarget if necessary See bug 570342 comment 3. Mickael, I believe this bug can be closed now?
Yes, I think this case was covered as part of bug 570242 *** This bug has been marked as a duplicate of bug 570242 ***