On Mon, 9 Oct 2023 22:41:21 GMT, Phil Race <p...@openjdk.org> wrote:

>> what is going on??  JTextArea inside a Scene with RTL orientation:
>> 
>> <img width="550" alt="Screenshot 2023-10-09 at 15 23 51" 
>> src="https://github.com/openjdk/jfx/assets/107069028/1bd9cda3-71d5-4e41-b475-d5b6c2a010d3";>
>
> JDK 8u doesn't have the fixes to deal with all of the macOS fonts in current 
> macOS, so its a little hard for me to test Arabic/bidi there since I get 
> garbage text.
> 
> I don't see that mirroring that you see, neither setting it on the TextArea 
> or on the Scene, but the text is way off to the right.
> Some layout issue.

^^ this looks like a separate bug, as it merely mirror images the whole 
SwingNode or its content.
Setting ComponentOrientation produces desired result, so perhaps we'd need to 
bind SwingNode's content component orientation to its node orientation.

But anyway, within JTextArea, the RIGHT arrow *always* moves to the right, and 
the LEFT arrow always moves to the left (of screen), regardless of component 
orientation which I think might be the "objectively correct" behavior.

Curiously, MS Word does not work this way, instead moving cursor *logically*.

The fixed code works similarly to what MS Word does, reversing the apparent 
direction within RTL/LTR blocks:
- In the LTR orientation, left moves the cursor left and right - to right 
within LTR text, which is what we want.
- In the RTL orientation, left moves left and right moves right within RTL 
text, which is also what we want.

I suppose the decision to work similarly to MS Word (and differently from 
swing?) was made early on and we are stuck with it.

Sooo, I guess the fix works as designed?
(I agree with your other objections to naming and javadoc, will fix).

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1220#discussion_r1350930618

Reply via email to