[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: 8178368: Right and Center alignment of text field works incorrectly [v5]
From:       John Hendrikx <jhendrikx () openjdk ! org>
Date:       2023-02-23 9:23:13
Message-ID: JY5pfrh0ixagitfyTD0_v1aZOvn8p_1vJSEqfykDPVo=.34ffc8c9-3744-47f1-ae73-5daeb7de7998 () github ! com
[Download RAW message or body]

On Thu, 23 Feb 2023 07:36:43 GMT, Karthik P K <kpk@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

I think this class may benefit from a few tests that test with a very wide caret, to \
see if positioning is what you'd expect in those cases as well.  I get the impression \
a lot of the code assumes a narrow caret (1 or 2 pixels) and this is why we see \
constants like `0` and `1` in the code, and even places where the caret width should \
be subtracted but isn't because it is assumed to be `0`.

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic