RFR: 8178368: Right alignment of text fields and alignment of prompt text works incorrectly [v8]

Karthik P K kpk at openjdk.org
Mon Mar 6 10:51:21 UTC 2023


> 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 with a new target base due to a merge or a rebase. The pull request now contains eight commits:

 - Merge branch 'master' into textfield_issue_fix
 - Fix text scroll issue when right aligned
 - Updating the code according to review comments
 - Fix text and prompt alignment issue
 - Merge branch 'openjdk:master' into textfield_issue_fix
 - Update comments
 - Fix textfield right and center alignment issues
 - Fix for TextField right alignement issue

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

Changes: https://git.openjdk.org/jfx/pull/980/files
 Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=980&range=07
  Stats: 129 lines in 2 files changed: 87 ins; 27 del; 15 mod
  Patch: https://git.openjdk.org/jfx/pull/980.diff
  Fetch: git fetch https://git.openjdk.org/jfx pull/980/head:pull/980

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


More information about the openjfx-dev mailing list