Summary: | StyledTextRenderer max width can be invalid | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Paul Pazderski <paul-eclipse> | ||||
Component: | SWT | Assignee: | Paul Pazderski <paul-eclipse> | ||||
Status: | REOPENED --- | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 4.13 | ||||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
See Also: |
https://git.eclipse.org/r/153247 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=795aeac59686647adf9dd0ea194583482609ac01 https://bugs.eclipse.org/bugs/show_bug.cgi?id=559230 |
||||||
Whiteboard: | |||||||
Bug Depends on: | |||||||
Bug Blocks: | 343086 | ||||||
Attachments: |
|
Description
Paul Pazderski
2019-11-22 17:38:34 EST
I wanted to make a minimal change which worked for the first case but not for the second. The first problem arise in StyledTextRenderer#textChanging. As last step it updates max width if the current max width line is part of the change. But the code block before can change the startLine variable which breaks the test if longest line is part of the change. But the update of max width itself is invalid. It calculates the longest line on partial unavailable data and the result is the longest known(!) line and not the longest of all lines. My proposed solution is to calculate max width more on demand. If the current max width is known we update it as we can but if not, e.g. a content change changed the max line the recalculation of max width is postponed until the width is actually needed. New Gerrit change created: https://git.eclipse.org/r/153247 Had not yet found the reason for test failure so need to move target milestone. Finally got this awful failure. Apparently the test was only failing on gerrit because of different system font... Will merge after M1. Gerrit change https://git.eclipse.org/r/153247 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=795aeac59686647adf9dd0ea194583482609ac01 Reopened because fix was reverted. |