2022-09-26 06:42 AM
Hi,
I am using word wrap with Text Area component:
textArea.setWideTextAction(WIDE_TEXT_WORDWRAP);
My texts are usually so long that they need to be wrapped to 3 lines.
I have seen no issue with the first wrap (between line 1 and 2), but the second warp (between lines 2 and 3) does not work correctly. The end word is usually broken in the middle (the library tries to put there as many characters as possible).
It appears as if "character wrap" is enabled between 2nd and 3rd line.
Tested on Touch GFX 4.20, but the behaviour was observed at least since 4.17 version.
Am I missing some settings? Or is it simply a bug?
Thanks,
Petr
2022-09-27 02:03 AM
Hello PWagn.1,
I've tried on my side and I did not reproduce the issue.
Is it possible for you to share your project ?
/Osman
2022-10-05 04:26 AM
Hi,
sorry for delay, it took me longer to further investigate.
The issue is caused by height of the text area. It seems that if the height is slightly lower than certain value, the library switches to character-wrapping instead of word wrapping on last but one line.
Example in my case:
For the height of 68 (or 64px) pixels, there is no visible cropping of the text on the bottom of text field.
I do not know, what is the specification, but I would expect that word wrapping should be used in all cases. Especially when the multi-line texts are not supported via GUI and they must be enabled via code. Then the determination of needed height is trial and error.
Thanks,
Petr
2022-10-05 04:35 AM
2022-10-05 04:45 AM
2022-10-11 07:07 AM
Hello PWagn.1,
We took note of this issue and have colleagues on it. That's very strange indeed.
"I would expect that word wrapping should be used in all cases. Especially when the multi-line texts are not supported via GUI and they must be enabled via code" --> Actually it's possible from TouchGFX Designer to enter multi lines texts :
Go to Texts section in the left panel and find your resource from there. You can then from this interface edit your text and just add a new line to it by pressing the "ENTER" key .
So I suggest you to use this workaround until we got a fix for this bug. You can also increase the height of your TextArea as you showed me.
I'll get back to you when I'll have more info about the fix.
/Osman