On Wed, 21 Dec 2022 10:58:50 GMT, Karthik P K <k...@openjdk.org> wrote:

> When Text width was more than TextField width, condition to update 
> `textTranslateX` was not getting satisfied as calculated value was negative. 
> Hence the text was getting aligned to previous `textTranslateX` value.
> 
> Added else block to update the `textTranslateX` value when calculated value 
> is negative.
> 
> Added unit test to validate the fix.

While the code change looks acceptable, I would like to point your attention to 
the difference in the behavior relative to the 'prompt' text.

When the prompt text length exceeds the width of the text field, it looks like 
the prompt text is right-aligned, and the end of the prompt text is visible 
(the prompt text is "<prompt>":

<img width="536" alt="Screen Shot 2022-12-21 at 15 09 19" 
src="https://user-images.githubusercontent.com/107069028/209020711-de1c2c27-6ee2-499f-94b0-581d289b5e5a.png";>

However, setting a long text results in the beginning of the said text showing 
(the text string is 
`"<beg-01234567890123456789012345678901234567890123456789012345678901234567890123456789-end>"`):

<img width="536" alt="Screen Shot 2022-12-21 at 15 09 30" 
src="https://user-images.githubusercontent.com/107069028/209020786-3d4b9177-d6b7-44eb-b3a7-f8869881069e.png";>

What I was expecting is the same behavior as the prompt text, i.e.:

<img width="536" alt="Screen Shot 2022-12-21 at 15 09 47" 
src="https://user-images.githubusercontent.com/107069028/209020871-fc013a1f-a4a7-4f7a-a7f4-3812837f2f6d.png";>

You can try it out with this application -
https://github.com/andy-goryachev-oracle/Test/blob/main/src/goryachev/ensemble/TestEnsembleApp.java

-------------

PR: https://git.openjdk.org/jfx/pull/980

Reply via email to