2022-02-14 03:46 AM
Hi,
Seemingly the following TextArea.. widget method misreports when used with 270 degree (and probably 90 degree) text. 0 degree (and probably 180 degree) text is fine: getTextHeight. Also setBaselineY, and TextAreaWith.. setXBaselineY likewise misposition said rotated text. Occurs whether singleline or multiline line text (courtesy wordwrap or \n).
The getTextHeight problem seems to be within the TextArea calculateTextHeight method, with getWidth use at the end of the line below. Does this not need to be getHeight for 90 or 270 degree text?
int16_t numLines = LCD::getNumLines(textProvider, wideTextAction, typedText.getTextDirection(), typedText.getFont(), getWidth());
In general, I suggest all needs a look at, with all four orientations, to check for correct reporting, and correct positioning, and/or the documentation needs caveating to say what's supported for non 0 degree rotations.
The company are using a bit of an old TouchGFX, 4.16.0. However nothing in the version history would suggest these issues have meanwhile been addressed. At some point, when things are calm on the company projects, I will endeavour to push for company-wide upgrade to 4.18.1. Or even better, a later version that fixes the bugs.
We've meantime worked around the issue, as we have two orientations, 0 degrees and 270 degrees. We cache dynamic text getTextHeight from the former, for use by the latter.
Best regards,
David King