| Summary: | [Label] Using a Label with WRAP truncates the text on resize if only width changed | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Sebastien Arod <sebastien.arod> | ||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P2 | CC: | tbuschto | ||||
| Version: | 2.0 | ||||||
| Target Milestone: | 2.1 RC1 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Note that the problem is fixed as soon as you resize vertically. I can reproduce it with your snippet. Overriding the _applyWidth method in MultiCellWidget.js fixes the issue:
...
_applyWidth : function( value, old ) {
this.base( arguments, value, old );
if( this._flexibleCell !== -1 ) {
this._scheduleLayoutY();
}
},
...
We have a test that have to ensure exactly this behavior (MultiCellWidgetTest.js#testFlexibleCellWrap), but it is green with/without this override. Tim, what do you think?
Fixed with commit b4f346505002ac1892aeb21d07e33fa744feee8e. The test was a false green because MultiCellWidget#getCellHeight always returns a freshly computed value, so the test did not check the actually rendered value. |
Created attachment 229692 [details] A snippet project showing the problem Reproducible case: * Create a Label with SWT.WRAP that fill the whole shell * Initialize the text to something that use more than 1 line * Size the shell so that it can fit more line than the text requires at initialization * Shrink the shell in width being careful not to change the height so that at least one new line should be created to display text. => The required new lines are not displayed and the text ends-up being truncated I attach a project to reproduce the bug. With the snippet just start the BugSnippetEntryPoint and reduce width until you see some truncated.