RFR: 8178368: Right and Center alignment of text field works incorrectly [v5]
Karthik P K
kpk at openjdk.org
Thu Feb 23 07:47:17 UTC 2023
On Thu, 23 Feb 2023 07:36:43 GMT, Karthik P K <kpk at openjdk.org> wrote:
>> When Text width was more than TextField width, the logic to update `textTranslateX` in `updateCaretOff` method was causing the issue of unexpected behavior for Right and Center alignment.
>>
>> Made changes to update `textTranslateX` in `updateCaretOff` method only when text width is less than text field width i.e `delta` is positive.
>> For both right and center alignments, the `textTranslateX` value calculated in `updateTextPos` method will be updated without any condition so that expected behavior is achieved for all scenarios of text width relative to text field width.
>>
>> Added unit tests to validate LEFT, CENTER and RIGHT alignments. RIGHT and CENTER alignment tests are expected to fail without the fix provided in this PR.
>
> Karthik P K has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix text and prompt alignment issue
Fixed the text alignment issue and changed the prompt text alignment behavior in consistent with text alignment behavior.
The text and prompt text alignment behavior will be as follows:
- When text/prompt length is less than text field width, text/prompt aligns according to the alignment type given.
- When text/prompt length is more than text field width, text/prompt aligns to the left showing the start of the text regardless of the alignment type given.
Please review these changes.
-------------
PR: https://git.openjdk.org/jfx/pull/980
More information about the openjfx-dev
mailing list