| Summary: | [Text] Height is larger than usual if contained text is very long | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Sebastien Arod <sebastien.arod> | ||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 2.0 | ||||||
| Target Milestone: | 2.1 M2 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Debugging the Text.computeSize() code it looks like the problem comes from TextSizeUtil.stringExtent( getFont(), text ). For short strings it returns an extent with y=8 For long strings it returns an extent with y=54 However debugging TextSizeStorageUtil further is too complex given my knowledge of RWT internals ;) Sebastien, I found what the problem is. On the client we have a div responsible for text size measurement. Currently the div is positioned at -1000px on left to prevent the text auto wrapping if the text width is bigger than browser width. In your case the text *is* bigger than 1000 + browser width and it's autowrap by browser when measured. As a result you have 2 lines of text. I can easily increase this left offset from -1000 to -10000 which solves the problem. What I don't understand is the use case of setting of such a big text in a single text filed (without wrapping). Fixed with commit 01123580890be0674d3d92db8453b0691578b963. Set measure node whiteSpace attribute to "nowrap" for texts that don't need wrapping. (In reply to comment #2) > Sebastien, I found what the problem is. On the client we have a div > responsible for text size measurement. Currently the div is positioned at > -1000px on left to prevent the text auto wrapping if the text width is > bigger than browser width. In your case the text *is* bigger than 1000 + > browser width and it's autowrap by browser when measured. As a result you > have 2 lines of text. I can easily increase this left offset from -1000 to > -10000 which solves the problem. What I don't understand is the use case of > setting of such a big text in a single text filed (without wrapping). Hi Ivan, Thanks for the fix. I agree that displaying such a long text in a single line text field is not ideal however it's still usable using text selection to scroll through the content. Regarding our usecase: our application generates forms from metedata described by user. When the user chooses that we should display some data as a single line text we respect users choice even if the content is large and we end up with the reported bug. Thanks -Seb |
Created attachment 229665 [details] Snippet project Text is Height is larger than usual if contained text is very long. Reproducible case using the Attached Snippet Project: * Run the snippet BugSnippetEntryPoint * Initial text height is ok * Click on the "Update very long text" button or type a very long text in the text widget * Text height is still ok * Click "Force layout" button or resize the browser window => The height is almost twice what it generally is